From cb2e1a17b309618e1bbea2a5b06968828a5f5ae6 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 3 Feb 2017 18:40:03 +0000 Subject: [PATCH] Fix some bugs in non blocking pipe writing --- src/shell_manager.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shell_manager.cc b/src/shell_manager.cc index 63ec22a5..a663c59f 100644 --- a/src/shell_manager.cc +++ b/src/shell_manager.cc @@ -215,12 +215,13 @@ std::pair ShellManager::eval( (size_t)contents.length()); if (size > 0) contents = contents.substr(ByteCount{(int)size}); - if (size == -1 and (errno = EAGAIN or errno == EWOULDBLOCK)) + if (size == -1 and (errno == EAGAIN or errno == EWOULDBLOCK)) return; if (size < 0 or contents.empty()) { pipe.close_write_fd(); watcher.disable(); + return; } } })