mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 13:33:09 +07:00
finit.c: set _PATH_STDPATH much earlier
This should allow us to run 'prog' without
absolute paths. Eg:
run("/bin/foo"); -> run("foo");
However we still need absolute PATH for
checking since fexist() need full path right now.
Signed-off-by: crazy <crazy@frugalware.org>
This commit is contained in:
+5
-3
@@ -251,6 +251,11 @@ int main(int argc, char* argv[])
|
||||
uev_init(&loop);
|
||||
ctx = &loop;
|
||||
|
||||
/*
|
||||
* Set the PATH early to something sane
|
||||
*/
|
||||
setenv("PATH", _PATH_STDPATH, 1);
|
||||
|
||||
/*
|
||||
* Mount base file system, kernel is assumed to run devtmpfs for /dev
|
||||
*/
|
||||
@@ -340,9 +345,6 @@ int main(int argc, char* argv[])
|
||||
/* Set hostname as soon as possible, for syslog et al. */
|
||||
set_hostname(&hostname);
|
||||
|
||||
/* Set default PATH, for uid 0 */
|
||||
setenv("PATH", _PATH_STDPATH, 1);
|
||||
|
||||
/*
|
||||
* Mount filesystems
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user