summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/shell_manager.cc5
1 files changed, 4 insertions, 1 deletions
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;