summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2021-10-17 16:12:35 +0200
committerTom Smeding <tom@tomsmeding.com>2021-10-17 16:12:35 +0200
commite6c6502b8e408c5a0c62bd0fa30f958fedc253f6 (patch)
tree4d6bb3961f810751604360a70dff253350405aca
parent4fd25ec14b335414fd96105df6bed64f4882ed1a (diff)
Proper handling of allowBrokenPipe
Apparently I didn't test this?
-rw-r--r--process.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/process.cpp b/process.cpp
index 6adc417..7bddc41 100644
--- a/process.cpp
+++ b/process.cpp
@@ -144,7 +144,7 @@ bool Process::writeLine(const string_view line, bool allowBrokenPipe) {
ssize_t nw = write(infd, str.data() + cursor, str.size() - cursor);
if (nw < 0) {
if (errno == EINTR) continue;
- if (allowBrokenPipe && errno == EPIPE) continue;
+ if (allowBrokenPipe && errno == EPIPE) break;
perror("write");
return false;
}