From e9556c6075d61d10f026d5166ff7cf5dfa3f6571 Mon Sep 17 00:00:00 2001 From: "Christopher M. Punches" Date: Thu, 8 Feb 2024 09:53:32 +0000 Subject: [PATCH] Update src/lcpex/liblcpex.cpp --- src/lcpex/liblcpex.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lcpex/liblcpex.cpp b/src/lcpex/liblcpex.cpp index fca54ff..5a2941d 100644 --- a/src/lcpex/liblcpex.cpp +++ b/src/lcpex/liblcpex.cpp @@ -281,9 +281,12 @@ int execute( byte_count = read(watched_fds[this_fd].fd, buf, BUFFER_SIZE); if (byte_count == -1) { - // error reading from pipe - perror("read"); - exit(EXIT_FAILURE); + if (errno == EAGAIN) { continue; } else { + // error reading from pipe + perror("read"); + exit(EXIT_FAILURE); + } + } else if (byte_count == 0) { // reached EOF on one of the streams but not a HUP // we've read all we can this cycle, so go to the next fd in the for loop