diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2000-07-25 19:52:51 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2000-07-25 19:52:51 +0000 |
commit | 7edd415649f0efee38e464bd6bd6875d1d04b4bb (patch) | |
tree | cbae9c8110bd401d5c80b3c3772aef2497ef6b81 /usr.bin/mg/ttyio.c | |
parent | c25458f05214d7354ffcebe6eac9dfdd89df55db (diff) |
o check that we are on a tty (and bail if not)
o in panic() just call exit() not abort()
Diffstat (limited to 'usr.bin/mg/ttyio.c')
-rw-r--r-- | usr.bin/mg/ttyio.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/mg/ttyio.c b/usr.bin/mg/ttyio.c index 8df4fe0dc0e..3d01d1a15a7 100644 --- a/usr.bin/mg/ttyio.c +++ b/usr.bin/mg/ttyio.c @@ -37,6 +37,9 @@ void ttopen() { + if (!isatty(STDIN_FILENO) || !isatty(STDOUT_FILENO)) + panic("standard input and output must be a terminal"); + if (ttraw() == FALSE) panic("aborting due to terminal initialize failure"); } @@ -205,7 +208,7 @@ panic(s) (void) fputs("panic: ", stderr); (void) fputs(s, stderr); (void) fputc('\n', stderr); - abort(); /* To leave a core image. */ + exit(1); } #ifndef NO_DPROMPT |