system/corennnnn
修订版 | 5673ac08ba5b3e5db97568a4614bfca59119447d (tree) |
---|---|
时间 | 2011-08-04 17:31:46 |
作者 | Jim Huang <jserv@0xla...> |
Commiter | Chih-Wei Huang |
Let console applications have a controlling tty.
Since the logic in open_console() is changed, terminating console
application within a shell is now possible via Ctrl-C.
@@ -121,6 +121,8 @@ static void open_console() | ||
121 | 121 | int fd; |
122 | 122 | if ((fd = open(console_name, O_RDWR)) < 0) { |
123 | 123 | fd = open("/dev/null", O_RDWR); |
124 | + } else { | |
125 | + ioctl(fd, TIOCSCTTY, 0); | |
124 | 126 | } |
125 | 127 | dup2(fd, 0); |
126 | 128 | dup2(fd, 1); |