pipe: return immediately from read_all/write_all on IO errors
This adds missing return paths to these functions, so that they
can exit immdeidately if any IO operation fails with -1.
Without this, these function can enter into a bogus infnite loop,
repeatedly adding -1 to the total byte count.
@@ -129,6 +129,7 @@ ssize_t flb_pipe_read_all(int fd, void *buf, size_t count)
flb_time_msleep(50);
continue;
}
+ return -1;
}
else if (bytes == 0) {
/* Broken pipe ? */
@@ -160,6 +161,7 @@ ssize_t flb_pipe_write_all(int fd, const void *buf, size_t count)
flb_time_msleep(50);
continue;
}
+ return -1;
}
else if (bytes == 0) {
/* Broken pipe ? */
