瀏覽代碼

handle interrupted getc in falliblesubprocess() prompt

Wichert Akkerman 25 年之前
父節點
當前提交
4cf22cc69c
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      dselect/method.cc

+ 2 - 2
dselect/method.cc

@@ -197,8 +197,8 @@ urqresult falliblesubprocess(const char *exepath, const char *name,
   fprintf(stderr,_("Press <enter> to continue.\n"));
   if (ferror(stderr))
     ohshite(_("write error on standard error"));
-  do { c= fgetc(stdin); } while (c != EOF && c != '\n');
-  if (c == EOF)
+  do { c= fgetc(stdin); } while ((c == ERR && errno==EINTR) || (c != '\n'));
+  if (c == ERR)
     ohshite(_("error reading acknowledgement of program failure message"));
   return urqr_fail;
 }