diff --git a/src/shell_manager.cc b/src/shell_manager.cc index b3605609..bd101633 100644 --- a/src/shell_manager.cc +++ b/src/shell_manager.cc @@ -176,9 +176,12 @@ FDWatcher make_reader(int fd, String& contents, OnClose&& on_close) char buffer[1024]; while (fd_readable(fd)) { - size_t size = ::read(fd, buffer, sizeof(buffer)); + ssize_t size = ::read(fd, buffer, sizeof(buffer)); if (size <= 0) { + if (size < 0 and errno == EAGAIN) + continue; // try again + watcher.disable(); on_close(); return;