瀏覽代碼

Userland: /bin/sh shouldn't crash on EINTR.

Andreas Kling 6 年之前
父節點
當前提交
fd575055c2
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      Userland/sh.cpp

+ 4 - 3
Userland/sh.cpp

@@ -415,9 +415,10 @@ int main(int argc, char** argv)
             return 0;
         if (nread < 0) {
             if (errno == EINTR) {
-                ASSERT(g->was_interrupted);
-                if (linedx != 0)
-                    printf("^C");
+                if (g->was_interrupted) {
+                    if (linedx != 0)
+                        printf("^C");
+                }
                 g->was_interrupted = false;
                 linebuf[0] = '\0';
                 linedx = 0;