]> git.pld-linux.org Git - packages/SysVinit.git/blame - sysvinit-notty.patch
- use macros in %{pre,post}{,un}
[packages/SysVinit.git] / sysvinit-notty.patch
CommitLineData
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 /*
This page took 0.070978 seconds and 4 git commands to generate.