Skip to content

Commit 9d0401e

Browse files
committed
posix: Fix HAVE_EXECVPE CPP guards
It turns out the autoconf upper-cases the symbol name.
1 parent 6cda6f3 commit 9d0401e

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

cbits/posix/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct std_handle {
2525
int get_max_fd(void);
2626

2727
// defined in find_executable.c
28-
#if !defined(HAVE_execvpe)
28+
#if !defined(HAVE_EXECVPE)
2929
char *find_executable(char *workingDirectory, char *filename);
3030
#endif
3131

cbits/posix/find_executable.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "common.h"
1313

1414
// the below is only necessary when we need to emulate execvpe.
15-
#if !defined(HAVE_execvpe)
15+
#if !defined(HAVE_EXECVPE)
1616

1717
/* A quick check for whether the given path is absolute. */
1818
static bool is_absolute(const char *path) {

cbits/posix/fork_exec.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* ensure that execvpe is provided if possible */
2+
#define _GNU_SOURCE 1
3+
14
#include "common.h"
25

36
#include <sys/types.h>
@@ -125,7 +128,7 @@ do_spawn_fork (char *const args[],
125128
// we emulate this using fork and exec. However, to safely do so
126129
// we need to perform all allocations *prior* to forking. Consequently, we
127130
// need to find_executable before forking.
128-
#if !defined(HAVE_execvpe)
131+
#if !defined(HAVE_EXECVPE)
129132
char *exec_path;
130133
if (environment) {
131134
exec_path = find_executable(workingDirectory, args[0]);
@@ -239,7 +242,7 @@ do_spawn_fork (char *const args[],
239242

240243
/* the child */
241244
if (environment) {
242-
#if defined(HAVE_execvpe)
245+
#if defined(HAVE_EXECVPE)
243246
// XXX Check result
244247
execvpe(args[0], args, environment);
245248
#else

0 commit comments

Comments
 (0)