projects
/
folly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
007d2a6
)
Throw on errors in read callback
author
Alexey Spiridonov
<lesha@fb.com>
Wed, 20 Apr 2016 19:08:29 +0000
(12:08 -0700)
committer
Facebook Github Bot 0
<facebook-github-bot-0-bot@fb.com>
Wed, 20 Apr 2016 19:20:24 +0000
(12:20 -0700)
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
patch
|
blob
|
history
diff --git
a/folly/Subprocess.h
b/folly/Subprocess.h
index c70a1f4b8ad73b4d3d36bbfa4387026f51fdf580..2b6cbffc864f697d705b6ee7735750ccc550df95 100644
(file)
--- a/
folly/Subprocess.h
+++ b/
folly/Subprocess.h
@@
-108,6
+108,7
@@
#include <boost/container/flat_map.hpp>
#include <boost/operators.hpp>
+#include <folly/Exception.h>
#include <folly/File.h>
#include <folly/FileUtil.h>
#include <folly/gen/String.h>
@@
-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;