Minor tweak to argv[0] handling for linuxrc
-Erik
This commit is contained in:
parent
5b911ddd57
commit
a51ecdd9e4
14
init.c
14
init.c
@ -803,10 +803,16 @@ extern int init_main(int argc, char **argv)
|
|||||||
int status;
|
int status;
|
||||||
|
|
||||||
#ifndef DEBUG_INIT
|
#ifndef DEBUG_INIT
|
||||||
/* Expect to be PID 1 if we are run as init (not linuxrc) */
|
/* Expect to be invoked as init with PID=1 or be invoked as linuxrc */
|
||||||
if (getpid() != 1 && strstr(argv[0], "init") != NULL) {
|
if (getpid() != 1
|
||||||
usage("init\n\nInit is the parent of all processes.\n\n"
|
#ifdef BB_FEATURE_LINUXRC
|
||||||
"This version of init is designed to be run only by the kernel\n");
|
&& strstr(argv[0], "linuxrc") == NULL
|
||||||
|
#endif
|
||||||
|
)
|
||||||
|
{
|
||||||
|
usage("init\n\nInit is the parent of all processes.\n\n"
|
||||||
|
"This version of init is designed to be run only "
|
||||||
|
"by the kernel.\n");
|
||||||
}
|
}
|
||||||
/* Set up sig handlers -- be sure to
|
/* Set up sig handlers -- be sure to
|
||||||
* clear all of these in run() */
|
* clear all of these in run() */
|
||||||
|
14
init/init.c
14
init/init.c
@ -803,10 +803,16 @@ extern int init_main(int argc, char **argv)
|
|||||||
int status;
|
int status;
|
||||||
|
|
||||||
#ifndef DEBUG_INIT
|
#ifndef DEBUG_INIT
|
||||||
/* Expect to be PID 1 if we are run as init (not linuxrc) */
|
/* Expect to be invoked as init with PID=1 or be invoked as linuxrc */
|
||||||
if (getpid() != 1 && strstr(argv[0], "init") != NULL) {
|
if (getpid() != 1
|
||||||
usage("init\n\nInit is the parent of all processes.\n\n"
|
#ifdef BB_FEATURE_LINUXRC
|
||||||
"This version of init is designed to be run only by the kernel\n");
|
&& strstr(argv[0], "linuxrc") == NULL
|
||||||
|
#endif
|
||||||
|
)
|
||||||
|
{
|
||||||
|
usage("init\n\nInit is the parent of all processes.\n\n"
|
||||||
|
"This version of init is designed to be run only "
|
||||||
|
"by the kernel.\n");
|
||||||
}
|
}
|
||||||
/* Set up sig handlers -- be sure to
|
/* Set up sig handlers -- be sure to
|
||||||
* clear all of these in run() */
|
* clear all of these in run() */
|
||||||
|
Loading…
Reference in New Issue
Block a user