Commit b8ec9e50 authored by Andrey Goder's avatar Andrey Goder Committed by Dave Watson

Use readNoInt/writeNoInt in folly::Subprocess

Summary: We have these helper methods, but are not using them. What sadness.

Test Plan:
fbconfig -r folly
fbmake runtests

Reviewed By: tudorb@fb.com

FB internal diff: D1299720
parent e29b86e4
...@@ -576,10 +576,7 @@ bool handleWrite(int fd, IOBufQueue& queue) { ...@@ -576,10 +576,7 @@ bool handleWrite(int fd, IOBufQueue& queue) {
return true; // EOF return true; // EOF
} }
ssize_t n; ssize_t n = writeNoInt(fd, p.first, p.second);
do {
n = ::write(fd, p.first, p.second);
} while (n == -1 && errno == EINTR);
if (n == -1 && errno == EAGAIN) { if (n == -1 && errno == EAGAIN) {
return false; return false;
} }
...@@ -592,10 +589,7 @@ bool handleWrite(int fd, IOBufQueue& queue) { ...@@ -592,10 +589,7 @@ bool handleWrite(int fd, IOBufQueue& queue) {
bool handleRead(int fd, IOBufQueue& queue) { bool handleRead(int fd, IOBufQueue& queue) {
for (;;) { for (;;) {
auto p = queue.preallocate(100, 65000); auto p = queue.preallocate(100, 65000);
ssize_t n; ssize_t n = readNoInt(fd, p.first, p.second);
do {
n = ::read(fd, p.first, p.second);
} while (n == -1 && errno == EINTR);
if (n == -1 && errno == EAGAIN) { if (n == -1 && errno == EAGAIN) {
return false; return false;
} }
...@@ -613,10 +607,7 @@ bool discardRead(int fd) { ...@@ -613,10 +607,7 @@ bool discardRead(int fd) {
static std::unique_ptr<char[]> buf(new char[bufSize]); static std::unique_ptr<char[]> buf(new char[bufSize]);
for (;;) { for (;;) {
ssize_t n; ssize_t n = readNoInt(fd, buf.get(), bufSize);
do {
n = ::read(fd, buf.get(), bufSize);
} while (n == -1 && errno == EINTR);
if (n == -1 && errno == EAGAIN) { if (n == -1 && errno == EAGAIN) {
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment