|
|
@ -36,6 +36,7 @@ static inline int dupall(int from)
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef NO_SEARCH_PATH
|
|
|
|
inline static int err_not_found(int er) {
|
|
|
|
inline static int err_not_found(int er) {
|
|
|
|
return er == ENOENT;
|
|
|
|
return er == ENOENT;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -69,13 +70,14 @@ static int path_lookup(size_t sz; const char name[restrict static 1], char fullp
|
|
|
|
free(_tmpfree);
|
|
|
|
free(_tmpfree);
|
|
|
|
return found;
|
|
|
|
return found;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // !NO_SEARCH_PATH
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char** argv, char** envp)
|
|
|
|
int main(int argc, char** argv, char** envp)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
(void)argc;
|
|
|
|
(void)argc;
|
|
|
|
#ifdef NO_ENV
|
|
|
|
#ifdef NO_ENV
|
|
|
|
#define GET_ENV ((char*[]){})
|
|
|
|
|
|
|
|
(void)envp;
|
|
|
|
(void)envp;
|
|
|
|
|
|
|
|
#define GET_ENV ((char*[]){NULL})
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
#define GET_ENV envp
|
|
|
|
#define GET_ENV envp
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -100,7 +102,7 @@ int main(int argc, char** argv, char** envp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(argv[1]) {
|
|
|
|
if(argv[1]) {
|
|
|
|
#if NO_SEARCH_PATH
|
|
|
|
#ifdef NO_SEARCH_PATH
|
|
|
|
if(UNLIKELY($execve(argv[1]) < 0)) {
|
|
|
|
if(UNLIKELY($execve(argv[1]) < 0)) {
|
|
|
|
perror("execve() failed");
|
|
|
|
perror("execve() failed");
|
|
|
|
return errno;
|
|
|
|
return errno;
|
|
|
|