X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fmonitor.c;h=5bc83c33968afc24eee586c4a92bbab88c2877a2;hb=77d7fddb855305e783c100bfe9b6b46bdb05e4b6;hp=ce0ef794db8e31b5de825697e8a7958c87314c99;hpb=7c96d7c62d46f4ba2711c06d45150e2441bbf1a7;p=sbcl.git diff --git a/src/runtime/monitor.c b/src/runtime/monitor.c index ce0ef79..5bc83c3 100644 --- a/src/runtime/monitor.c +++ b/src/runtime/monitor.c @@ -273,8 +273,7 @@ search_cmd(char **ptr) end += 2; if (widetag_of(obj) == SIMPLE_FUN_HEADER_WIDETAG) { print((long)addr | FUN_POINTER_LOWTAG); - } else if (lowtag_of(obj) == OTHER_IMMEDIATE_0_LOWTAG || - lowtag_of(obj) == OTHER_IMMEDIATE_1_LOWTAG) { + } else if (other_immediate_lowtag_p(obj)) { print((lispobj)addr | OTHER_POINTER_LOWTAG); } else { print((lispobj)addr); @@ -302,9 +301,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 +453,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