]>
Commit | Line | Data |
---|---|---|
1f2f436a A |
1 | --- exec.c.orig 2010-07-06 16:02:22.000000000 -0700 |
2 | +++ exec.c 2010-07-06 16:31:46.000000000 -0700 | |
3 | @@ -48,7 +48,11 @@ __FBSDID("$FreeBSD: src/lib/libc/gen/exe | |
9385eb3d | 4 | #include "un-namespace.h" |
1f2f436a | 5 | #include "libc_private.h" |
9385eb3d A |
6 | |
7 | -extern char **environ; | |
8 | +#include <crt_externs.h> | |
9 | +#define environ (*_NSGetEnviron()) | |
1f2f436a A |
10 | + |
11 | +int | |
12 | +_execvpe(const char *name, char * const argv[], char * const envp[]); | |
9385eb3d A |
13 | |
14 | int | |
15 | execl(const char *name, const char *arg, ...) | |
1f2f436a | 16 | @@ -259,8 +263,9 @@ retry: (void)_execve(bp, argv, envp); |
3d9156a7 A |
17 | } |
18 | if (eacces) | |
19 | errno = EACCES; | |
20 | - else | |
21 | + else if (cur) | |
22 | errno = ENOENT; | |
23 | + /* else use existing errno from _execve */ | |
24 | done: | |
25 | return (-1); | |
26 | } | |
1f2f436a A |
27 | @@ -271,7 +276,7 @@ execvP(const char *name, const char *pat |
28 | return execvPe(name, path, argv, environ); | |
29 | } | |
30 | ||
31 | -int | |
32 | +__private_extern__ int | |
33 | _execvpe(const char *name, char * const argv[], char * const envp[]) | |
34 | { | |
35 | const char *path; |