Only try to use F_SETPIPE_SZ if it's available
authorSara Golemon <sgolemon@fb.com>
Wed, 15 Jul 2015 16:44:05 +0000 (09:44 -0700)
committerSara Golemon <sgolemon@fb.com>
Wed, 15 Jul 2015 20:25:12 +0000 (13:25 -0700)
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

index 7d14a4af7c7f72bef9d1bf0da7b96b848c16548f..e9fa7d7ee50c0f14e3bfa3ec0f3ee289f5efd78f 100644 (file)
@@ -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];