Explorar o código

handle interrupted getc in falliblesubprocess() prompt

Wichert Akkerman %!s(int64=25) %!d(string=hai) anos
pai
achega
4cf22cc69c
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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;
 }