]>
Commit | Line | Data |
---|---|---|
41a10d9d | 1 | --- sysvinit-2.78/src/sulogin.c.foo Wed Jan 31 14:06:36 2001 |
2 | +++ sysvinit-2.78/src/sulogin.c Wed Jan 31 15:37:18 2001 | |
3 | @@ -366,7 +366,8 @@ | |
4 | signal(SIGINT, SIG_IGN); | |
5 | signal(SIGTSTP, SIG_IGN); | |
6 | if (optind < argc) tty = argv[optind]; | |
7 | - if (tty) { | |
8 | + if (tty && (fd = open(tty, O_RDONLY)) >= 0 && isatty(fd)) { | |
9 | + close(fd); | |
10 | if ((fd = open(tty, O_RDWR)) >= 0) { | |
11 | ||
12 | /* | |
13 | @@ -400,6 +401,8 @@ | |
14 | close(fd); | |
15 | } else | |
16 | perror(tty); | |
17 | + } else { | |
18 | + if (fd>0) close(fd); | |
19 | } | |
20 | ||
21 | /* |