Skip to content

Commit d7e2e12

Browse files
committed
cttyhack: add missing ';'
init: remove pointless access() check
1 parent 2afabe8 commit d7e2e12

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

init/init.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -513,11 +513,13 @@ static void run_actions(int action)
513513
for (a = init_action_list; a; a = tmp) {
514514
tmp = a->next;
515515
if (a->action == action) {
516-
/* a->terminal of "" means "init's console" */
517-
if (a->terminal[0] && access(a->terminal, R_OK | W_OK)) {
518-
//message(L_LOG | L_CONSOLE, "Device %s cannot be opened in RW mode", a->terminal /*, strerror(errno)*/);
519-
delete_init_action(a);
520-
} else if (a->action & (SYSINIT | WAIT | CTRLALTDEL | SHUTDOWN | RESTART)) {
516+
// Pointless: run() will error out if open of device fails.
517+
///* a->terminal of "" means "init's console" */
518+
//if (a->terminal[0] && access(a->terminal, R_OK | W_OK)) {
519+
// //message(L_LOG | L_CONSOLE, "Device %s cannot be opened in RW mode", a->terminal /*, strerror(errno)*/);
520+
// delete_init_action(a);
521+
//} else
522+
if (a->action & (SYSINIT | WAIT | CTRLALTDEL | SHUTDOWN | RESTART)) {
521523
waitfor(run(a));
522524
delete_init_action(a);
523525
} else if (a->action & ONCE) {

shell/cttyhack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ int cttyhack_main(int argc, char **argv)
6969
dup2(fd, 2);
7070
while (fd > 2) close(fd--);
7171
/* Some other session may have it as ctty. Steal it from them */
72-
ioctl(0, TIOCSCTTY, 1)
72+
ioctl(0, TIOCSCTTY, 1);
7373
}
7474

7575
BB_EXECVP(argv[0], argv);

0 commit comments

Comments
 (0)