From aa088ebef6319194a0a762bc16629d5187ec2f00 Mon Sep 17 00:00:00 2001 From: Alexey Spiridonov Date: Wed, 20 Apr 2016 12:08:29 -0700 Subject: [PATCH] Throw on errors in read callback Summary: Before this fix, the callback would silently ignore `ret == -1` if the error isn't `EAGAIN`. Reviewed By: spacedentist Differential Revision: D3193845 fb-gh-sync-id: e4a7aa37de7dab8ebe0633dd9888d8adc11dd1c2 fbshipit-source-id: e4a7aa37de7dab8ebe0633dd9888d8adc11dd1c2 --- folly/Subprocess.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/folly/Subprocess.h b/folly/Subprocess.h index c70a1f4b..2b6cbffc 100644 --- a/folly/Subprocess.h +++ b/folly/Subprocess.h @@ -108,6 +108,7 @@ #include #include +#include #include #include #include @@ -683,6 +684,7 @@ class Subprocess { if (ret == -1 && errno == EAGAIN) { // No more data for now return false; } + checkUnixError(ret, "read"); if (ret == 0) { // Reached end-of-file splitter.flush(); // Ignore return since the file is over anyway return true; -- 2.34.1