summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Src/exec.c b/Src/exec.c
index ce8cf8c55..35b0bb191 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -4599,8 +4599,8 @@ readoutput(int in, int qt, int *readerror)
 	}
 	*ptr++ = c;
     }
-    if (readerror && ferror(fin))
-	*readerror = errno;
+    if (readerror)
+	*readerror = ferror(fin) ? errno : 0;
     fclose(fin);
     while (cnt && ptr[-1] == '\n')
 	ptr--, cnt--;