diff options
author | Erik Andersen <andersen@codepoet.org> | 2000-02-24 18:09:58 +0000 |
---|---|---|
committer | Erik Andersen <andersen@codepoet.org> | 2000-02-24 18:09:58 +0000 |
commit | a51ecdd9e4025d072d2737d6bea8a1d03bc74274 (patch) | |
tree | c9a3a179b8e9d2f149d63e9eeddfe9331f9b66db | |
parent | 5b911ddd577373dfcbd3d2dade7089ff611ea35e (diff) | |
download | busybox-w32-a51ecdd9e4025d072d2737d6bea8a1d03bc74274.tar.gz busybox-w32-a51ecdd9e4025d072d2737d6bea8a1d03bc74274.tar.bz2 busybox-w32-a51ecdd9e4025d072d2737d6bea8a1d03bc74274.zip |
Minor tweak to argv[0] handling for linuxrc
-Erik
-rw-r--r-- | init.c | 14 | ||||
-rw-r--r-- | init/init.c | 14 |
2 files changed, 20 insertions, 8 deletions
@@ -803,10 +803,16 @@ extern int init_main(int argc, char **argv) | |||
803 | int status; | 803 | int status; |
804 | 804 | ||
805 | #ifndef DEBUG_INIT | 805 | #ifndef DEBUG_INIT |
806 | /* Expect to be PID 1 if we are run as init (not linuxrc) */ | 806 | /* Expect to be invoked as init with PID=1 or be invoked as linuxrc */ |
807 | if (getpid() != 1 && strstr(argv[0], "init") != NULL) { | 807 | if (getpid() != 1 |
808 | usage("init\n\nInit is the parent of all processes.\n\n" | 808 | #ifdef BB_FEATURE_LINUXRC |
809 | "This version of init is designed to be run only by the kernel\n"); | 809 | && strstr(argv[0], "linuxrc") == NULL |
810 | #endif | ||
811 | ) | ||
812 | { | ||
813 | usage("init\n\nInit is the parent of all processes.\n\n" | ||
814 | "This version of init is designed to be run only " | ||
815 | "by the kernel.\n"); | ||
810 | } | 816 | } |
811 | /* Set up sig handlers -- be sure to | 817 | /* Set up sig handlers -- be sure to |
812 | * clear all of these in run() */ | 818 | * clear all of these in run() */ |
diff --git a/init/init.c b/init/init.c index 6ec811599..183739180 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -803,10 +803,16 @@ extern int init_main(int argc, char **argv) | |||
803 | int status; | 803 | int status; |
804 | 804 | ||
805 | #ifndef DEBUG_INIT | 805 | #ifndef DEBUG_INIT |
806 | /* Expect to be PID 1 if we are run as init (not linuxrc) */ | 806 | /* Expect to be invoked as init with PID=1 or be invoked as linuxrc */ |
807 | if (getpid() != 1 && strstr(argv[0], "init") != NULL) { | 807 | if (getpid() != 1 |
808 | usage("init\n\nInit is the parent of all processes.\n\n" | 808 | #ifdef BB_FEATURE_LINUXRC |
809 | "This version of init is designed to be run only by the kernel\n"); | 809 | && strstr(argv[0], "linuxrc") == NULL |
810 | #endif | ||
811 | ) | ||
812 | { | ||
813 | usage("init\n\nInit is the parent of all processes.\n\n" | ||
814 | "This version of init is designed to be run only " | ||
815 | "by the kernel.\n"); | ||
810 | } | 816 | } |
811 | /* Set up sig handlers -- be sure to | 817 | /* Set up sig handlers -- be sure to |
812 | * clear all of these in run() */ | 818 | * clear all of these in run() */ |