mostly formatting
This commit is contained in:
parent
544819c936
commit
85378253f3
9
init.c
9
init.c
@ -574,11 +574,9 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
/* Check for given init */
|
/* Check for given init */
|
||||||
init = get_from_env("INIT", myenv);
|
init = get_from_env("INIT", myenv);
|
||||||
if ( init && ! stat(init, &ist) && S_ISREG(ist.st_mode))
|
if (init == NULL) init = STAGE2_BINNAME;
|
||||||
argv[0] = init;
|
|
||||||
else if ( ! stat(STAGE2_BINNAME, &ist) && S_ISREG(ist.st_mode))
|
if (stat(init, &ist) || !S_ISREG(ist.st_mode) || !(ist.st_mode & S_IXUSR))
|
||||||
argv[0] = STAGE2_BINNAME;
|
|
||||||
else
|
|
||||||
fatal("can't find init on root fs");
|
fatal("can't find init on root fs");
|
||||||
|
|
||||||
/* Spawn init */
|
/* Spawn init */
|
||||||
@ -587,6 +585,7 @@ int main(int argc, char **argv)
|
|||||||
/* unblock signals */
|
/* unblock signals */
|
||||||
sigprocmask(SIG_UNBLOCK, &sig, NULL);
|
sigprocmask(SIG_UNBLOCK, &sig, NULL);
|
||||||
|
|
||||||
|
argv[0] = init;
|
||||||
execve(argv[0], argv, myenv);
|
execve(argv[0], argv, myenv);
|
||||||
fatal("stage2"); /* Failed to spawn init */
|
fatal("stage2"); /* Failed to spawn init */
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user