summaryrefslogtreecommitdiff
path: root/Userland/sh.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-02-20 23:45:00 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-02-20 23:45:00 +0100
commitfd575055c2215ce2ce42efaa82be53a94c7b3932 (patch)
tree80bb4ddf3264c30fc4ddc228fce4e379c2bcd18b /Userland/sh.cpp
parent0aaec6b19abf1e6e2a9bcc9eca201f45adbb797f (diff)
downloadserenity-fd575055c2215ce2ce42efaa82be53a94c7b3932.zip
Userland: /bin/sh shouldn't crash on EINTR.
Diffstat (limited to 'Userland/sh.cpp')
-rw-r--r--Userland/sh.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Userland/sh.cpp b/Userland/sh.cpp
index 0cd80c8628..441dcbd798 100644
--- a/Userland/sh.cpp
+++ b/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;