mirror of
https://github.com/sheumann/hush.git
synced 2025-01-04 22:34:37 +00:00
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
This commit is contained in:
parent
bdc8db9685
commit
53f5061c7e
14
init.c
14
init.c
@ -440,6 +440,12 @@ static pid_t run(char *command, char *terminal, int get_enter)
|
|||||||
signal(SIGHUP, SIG_DFL);
|
signal(SIGHUP, SIG_DFL);
|
||||||
|
|
||||||
if ((fd = device_open(terminal, O_RDWR)) < 0) {
|
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);
|
message(LOG | CONSOLE, "Bummer, can't open %s\r\n", terminal);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -813,16 +819,8 @@ static void parse_inittab(void)
|
|||||||
while (a->name != 0) {
|
while (a->name != 0) {
|
||||||
if (strcmp(a->name, action) == 0) {
|
if (strcmp(a->name, action) == 0) {
|
||||||
if (*id != '\0') {
|
if (*id != '\0') {
|
||||||
struct stat statBuf;
|
|
||||||
|
|
||||||
strcpy(tmpConsole, "/dev/");
|
strcpy(tmpConsole, "/dev/");
|
||||||
strncat(tmpConsole, id, 200);
|
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;
|
id = tmpConsole;
|
||||||
}
|
}
|
||||||
new_initAction(a->action, process, id);
|
new_initAction(a->action, process, id);
|
||||||
|
14
init/init.c
14
init/init.c
@ -440,6 +440,12 @@ static pid_t run(char *command, char *terminal, int get_enter)
|
|||||||
signal(SIGHUP, SIG_DFL);
|
signal(SIGHUP, SIG_DFL);
|
||||||
|
|
||||||
if ((fd = device_open(terminal, O_RDWR)) < 0) {
|
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);
|
message(LOG | CONSOLE, "Bummer, can't open %s\r\n", terminal);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -813,16 +819,8 @@ static void parse_inittab(void)
|
|||||||
while (a->name != 0) {
|
while (a->name != 0) {
|
||||||
if (strcmp(a->name, action) == 0) {
|
if (strcmp(a->name, action) == 0) {
|
||||||
if (*id != '\0') {
|
if (*id != '\0') {
|
||||||
struct stat statBuf;
|
|
||||||
|
|
||||||
strcpy(tmpConsole, "/dev/");
|
strcpy(tmpConsole, "/dev/");
|
||||||
strncat(tmpConsole, id, 200);
|
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;
|
id = tmpConsole;
|
||||||
}
|
}
|
||||||
new_initAction(a->action, process, id);
|
new_initAction(a->action, process, id);
|
||||||
|
Loading…
Reference in New Issue
Block a user