From 69ed661a488c0e02bf5fee3dc21e6a31a99a8d85 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 17 Oct 2015 00:58:39 +0200 Subject: fix errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/unistd/execat.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'src/unistd/execat.c') diff --git a/src/unistd/execat.c b/src/unistd/execat.c index a90fffb..bcff176 100644 --- a/src/unistd/execat.c +++ b/src/unistd/execat.c @@ -22,8 +22,15 @@ #include #include #include -#include -#include +/* TODO #include */ +/* TODO #include */ +/* TODO temporary contants/structs from other headers { */ +#define AT_FDCWD 1 +#define AT_EMPTY_PATH 1 +#define AT_SYMLINK_NOFOLLOW 1 +#define _CS_PATH 1 +struct stat { int st_mode; }; +/* } */ @@ -150,8 +157,8 @@ int execlpat(int dirfd, const char* file, ... /*, NULL, int flags */) { int saved_errno; va_list argv; - va_start(argv, path); - vexecat(dirfd, path, argv, 0, 1); + va_start(argv, file); + vexecat(dirfd, file, argv, 0, 1); saved_errno = errno; va_end(argv); return errno = saved_errno, -1; @@ -244,8 +251,8 @@ int execlpeat(int dirfd, const char* file, ... /*, NULL, char* const[] envp, int { int saved_errno; va_list argv; - va_start(argv, path); - vexecat(dirfd, path, argv, 1, 1); + va_start(argv, file); + vexecat(dirfd, file, argv, 1, 1); saved_errno = errno; va_end(argv); return errno = saved_errno, -1; @@ -330,7 +337,7 @@ int execvat(int dirfd, const char* path, char* const argv[], int flags) */ int execvpat(int dirfd, const char* file, char* const argv[], int flags) { - return execvpe(dirfd, path, argv, environ, flags); + return execvpeat(dirfd, file, argv, environ, flags); } @@ -452,7 +459,7 @@ int execvpeat(int dirfd, const char* file, char* const argv[], char* const envp[ if (strchr(file, '/') || !*file) return execveat(dirfd, file, argv, envp, flags); - path = getenv(PATH); + path = getenv("PATH"); if (path == NULL) { execveat(dirfd, file, argv, envp, flags); @@ -494,7 +501,7 @@ int execvpeat(int dirfd, const char* file, char* const argv[], char* const envp[ free(path); free(pathname); - return errno = (eaccess ? EACCES : ENOENT), -1; + return errno = (eacces ? EACCES : ENOENT), -1; fail: saved_errno = errno; -- cgit v1.2.3-70-g09d2