From c23480d053e7dee1f03fdac937a31b3bae766993 Mon Sep 17 00:00:00 2001 From: Sara Golemon Date: Wed, 15 Jul 2015 09:44:05 -0700 Subject: [PATCH] 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 --- folly/wangle/channel/FileRegion.cpp | 2 ++ 1 file changed, 2 insertions(+) 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]; -- 2.34.1