aboutsummaryrefslogtreecommitdiff
path: root/init.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-03-14 09:01:11 +0000
committerEric Andersen <andersen@codepoet.org>2001-03-14 09:01:11 +0000
commit53f5061c7e823f7ee511023f92b19980b40fdefd (patch)
tree74d22491dd1586c63e78af7a53a43ac84efd1097 /init.c
parentbdc8db9685374c6e71ca89a194c0cfcf97503d69 (diff)
downloadbusybox-53f5061c7e823f7ee511023f92b19980b40fdefd.tar.gz
Fix init so that checking for terminal devices is delayed until the
devices are actually used, thereby allowing devfsd based systems to work. This should fix bug #1133 -Erik
Diffstat (limited to 'init.c')
-rw-r--r--init.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/init.c b/init.c
index a0f15b0ff..53e9744c5 100644
--- a/init.c
+++ b/init.c
@@ -440,6 +440,12 @@ static pid_t run(char *command, char *terminal, int get_enter)
signal(SIGHUP, SIG_DFL);
if ((fd = device_open(terminal, O_RDWR)) < 0) {
+ struct stat statBuf;
+ if (stat(terminal, &statBuf) != 0) {
+ message(LOG | CONSOLE, "device '%s' does not exist.\n",
+ terminal);
+ exit(1);
+ }
message(LOG | CONSOLE, "Bummer, can't open %s\r\n", terminal);
exit(1);
}
@@ -813,16 +819,8 @@ static void parse_inittab(void)
while (a->name != 0) {
if (strcmp(a->name, action) == 0) {
if (*id != '\0') {
- struct stat statBuf;
-
strcpy(tmpConsole, "/dev/");
strncat(tmpConsole, id, 200);
- if (stat(tmpConsole, &statBuf) != 0) {
- message(LOG | CONSOLE,
- "device '%s' does not exist. Did you read the directions?\n",
- tmpConsole);
- break;
- }
id = tmpConsole;
}
new_initAction(a->action, process, id);