]> git.saurik.com Git - apple/libc.git/blob - gen/FreeBSD/exec.c.patch
e1303a4602234b6cb3ff52e267c362640c3c4789
[apple/libc.git] / gen / FreeBSD / exec.c.patch
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
4 #include "un-namespace.h"
5 #include "libc_private.h"
6
7 -extern char **environ;
8 +#include <crt_externs.h>
9 +#define environ (*_NSGetEnviron())
10 +
11 +int
12 +_execvpe(const char *name, char * const argv[], char * const envp[]);
13
14 int
15 execl(const char *name, const char *arg, ...)
16 @@ -259,8 +263,9 @@ retry: (void)_execve(bp, argv, envp);
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 }
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;