Update src/lcpex/liblcpex.cpp

master
Christopher M. Punches 2024-02-08 09:53:32 +00:00
parent 130d539f81
commit e9556c6075
1 changed files with 6 additions and 3 deletions

View File

@ -281,9 +281,12 @@ int execute(
byte_count = read(watched_fds[this_fd].fd, buf, BUFFER_SIZE); byte_count = read(watched_fds[this_fd].fd, buf, BUFFER_SIZE);
if (byte_count == -1) { if (byte_count == -1) {
// error reading from pipe if (errno == EAGAIN) { continue; } else {
perror("read"); // error reading from pipe
exit(EXIT_FAILURE); perror("read");
exit(EXIT_FAILURE);
}
} else if (byte_count == 0) { } else if (byte_count == 0) {
// reached EOF on one of the streams but not a HUP // 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 // we've read all we can this cycle, so go to the next fd in the for loop