X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fmonitor.c;h=6920df4e47fbe795e868742902abc884ffef5db8;hb=d25e3478acccec70402ff32554669a982be8e281;hp=ce0ef794db8e31b5de825697e8a7958c87314c99;hpb=7c96d7c62d46f4ba2711c06d45150e2441bbf1a7;p=sbcl.git diff --git a/src/runtime/monitor.c b/src/runtime/monitor.c index ce0ef79..6920df4 100644 --- a/src/runtime/monitor.c +++ b/src/runtime/monitor.c @@ -302,9 +302,13 @@ quit_cmd(char **ptr) printf("Really quit? [y] "); fflush(stdout); - fgets(buf, sizeof(buf), ldb_in); - if (buf[0] == 'y' || buf[0] == 'Y' || buf[0] == '\n') + if (fgets(buf, sizeof(buf), ldb_in)) { + if (buf[0] == 'y' || buf[0] == 'Y' || buf[0] == '\n') + exit(1); + } else { + printf("\nUnable to read response, assuming y.\n"); exit(1); + } } static void @@ -450,6 +454,10 @@ sub_monitor(void) if (!ldb_in) { #ifndef LISP_FEATURE_WIN32 ldb_in = fopen("/dev/tty","r+"); + if (ldb_in == NULL) { + perror("Error opening /dev/tty"); + ldb_in = stdin; + } #else ldb_in = stdin; #endif