diff options
-rw-r--r-- | init.c | 14 | ||||
-rw-r--r-- | init/init.c | 14 |
2 files changed, 12 insertions, 16 deletions
@@ -440,6 +440,12 @@ static pid_t run(char *command, char *terminal, int get_enter) | |||
440 | signal(SIGHUP, SIG_DFL); | 440 | signal(SIGHUP, SIG_DFL); |
441 | 441 | ||
442 | if ((fd = device_open(terminal, O_RDWR)) < 0) { | 442 | if ((fd = device_open(terminal, O_RDWR)) < 0) { |
443 | struct stat statBuf; | ||
444 | if (stat(terminal, &statBuf) != 0) { | ||
445 | message(LOG | CONSOLE, "device '%s' does not exist.\n", | ||
446 | terminal); | ||
447 | exit(1); | ||
448 | } | ||
443 | message(LOG | CONSOLE, "Bummer, can't open %s\r\n", terminal); | 449 | message(LOG | CONSOLE, "Bummer, can't open %s\r\n", terminal); |
444 | exit(1); | 450 | exit(1); |
445 | } | 451 | } |
@@ -813,16 +819,8 @@ static void parse_inittab(void) | |||
813 | while (a->name != 0) { | 819 | while (a->name != 0) { |
814 | if (strcmp(a->name, action) == 0) { | 820 | if (strcmp(a->name, action) == 0) { |
815 | if (*id != '\0') { | 821 | if (*id != '\0') { |
816 | struct stat statBuf; | ||
817 | |||
818 | strcpy(tmpConsole, "/dev/"); | 822 | strcpy(tmpConsole, "/dev/"); |
819 | strncat(tmpConsole, id, 200); | 823 | strncat(tmpConsole, id, 200); |
820 | if (stat(tmpConsole, &statBuf) != 0) { | ||
821 | message(LOG | CONSOLE, | ||
822 | "device '%s' does not exist. Did you read the directions?\n", | ||
823 | tmpConsole); | ||
824 | break; | ||
825 | } | ||
826 | id = tmpConsole; | 824 | id = tmpConsole; |
827 | } | 825 | } |
828 | new_initAction(a->action, process, id); | 826 | new_initAction(a->action, process, id); |
diff --git a/init/init.c b/init/init.c index a0f15b0ff..53e9744c5 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -440,6 +440,12 @@ static pid_t run(char *command, char *terminal, int get_enter) | |||
440 | signal(SIGHUP, SIG_DFL); | 440 | signal(SIGHUP, SIG_DFL); |
441 | 441 | ||
442 | if ((fd = device_open(terminal, O_RDWR)) < 0) { | 442 | if ((fd = device_open(terminal, O_RDWR)) < 0) { |
443 | struct stat statBuf; | ||
444 | if (stat(terminal, &statBuf) != 0) { | ||
445 | message(LOG | CONSOLE, "device '%s' does not exist.\n", | ||
446 | terminal); | ||
447 | exit(1); | ||
448 | } | ||
443 | message(LOG | CONSOLE, "Bummer, can't open %s\r\n", terminal); | 449 | message(LOG | CONSOLE, "Bummer, can't open %s\r\n", terminal); |
444 | exit(1); | 450 | exit(1); |
445 | } | 451 | } |
@@ -813,16 +819,8 @@ static void parse_inittab(void) | |||
813 | while (a->name != 0) { | 819 | while (a->name != 0) { |
814 | if (strcmp(a->name, action) == 0) { | 820 | if (strcmp(a->name, action) == 0) { |
815 | if (*id != '\0') { | 821 | if (*id != '\0') { |
816 | struct stat statBuf; | ||
817 | |||
818 | strcpy(tmpConsole, "/dev/"); | 822 | strcpy(tmpConsole, "/dev/"); |
819 | strncat(tmpConsole, id, 200); | 823 | strncat(tmpConsole, id, 200); |
820 | if (stat(tmpConsole, &statBuf) != 0) { | ||
821 | message(LOG | CONSOLE, | ||
822 | "device '%s' does not exist. Did you read the directions?\n", | ||
823 | tmpConsole); | ||
824 | break; | ||
825 | } | ||
826 | id = tmpConsole; | 824 | id = tmpConsole; |
827 | } | 825 | } |
828 | new_initAction(a->action, process, id); | 826 | new_initAction(a->action, process, id); |