From: Sara Golemon Date: Wed, 15 Jul 2015 16:44:05 +0000 (-0700) Subject: Only try to use F_SETPIPE_SZ if it's available X-Git-Tag: v0.51.0~11 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=c23480d053e7dee1f03fdac937a31b3bae766993;p=folly.git Only try to use F_SETPIPE_SZ if it's available Summary: As the comment says, we can ignore errors in setting the size. So it stands to reason we can ignore setting the size as well. Reviewed By: @yfeldblum Differential Revision: D2242882 --- diff --git a/folly/wangle/channel/FileRegion.cpp b/folly/wangle/channel/FileRegion.cpp index 7d14a4af..e9fa7d7e 100644 --- a/folly/wangle/channel/FileRegion.cpp +++ b/folly/wangle/channel/FileRegion.cpp @@ -122,11 +122,13 @@ void FileRegion::FileWriteRequest::start() { return; } +#ifdef F_SETPIPE_SZ // Max size for unprevileged processes as set in /proc/sys/fs/pipe-max-size // Ignore failures and just roll with it // TODO maybe read max size from /proc? fcntl(pipeFds[0], F_SETPIPE_SZ, 1048576); fcntl(pipeFds[1], F_SETPIPE_SZ, 1048576); +#endif pipe_out_ = pipeFds[0];