diff --git a/sw/airborne/fms/onboard_transport.c b/sw/airborne/fms/onboard_transport.c index d64c992d78..736a9b2121 100644 --- a/sw/airborne/fms/onboard_transport.c +++ b/sw/airborne/fms/onboard_transport.c @@ -148,6 +148,10 @@ static int open_piped(char *filepath) // copy from the read side of the pipe to the log while (1) { count = read(pipe_fd[0], buffer, LOG_BUFLEN); + if (count < 0) { + // error, presumably the pipe is closed + break; + } retval = write(fd, buffer, count); } } else {