summaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/shell/shell.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/shell/shell.c b/src/cmd/shell/shell.c
index 3f33756..1387e48 100644
--- a/src/cmd/shell/shell.c
+++ b/src/cmd/shell/shell.c
@@ -115,7 +115,7 @@ void run_args(int argc, char **argv, struct redir *redir) {
close(p[1]);
for (;;) {
long len = _sys_read(p[0], buf, buflen, 0);
- if (len < 0) exit(0);
+ if (len <= 0) exit(0);
fwrite(buf, 1, len, f);
if (ferror(f)) exit(0);
}