F_SETPIPE_SZ: check for existence before using (#1505)
Kernels before 2.6.35 do not have F_SETPIPE_SZ defined.
Fixes https://github.com/pagespeed/ngx_pagespeed/issues/1503
diff --git a/src/ngx_event_connection.cc b/src/ngx_event_connection.cc
index 1848f1b..6ab88f9 100644
--- a/src/ngx_event_connection.cc
+++ b/src/ngx_event_connection.cc
@@ -57,7 +57,9 @@
// See https://github.com/pagespeed/ngx_pagespeed/issues/1380
// TODO(oschaaf): Consider implementing a queueing mechanism for retrying
// failed writes.
+#ifdef F_SETPIPE_SZ
fcntl(pipe_write_fd_, F_SETPIPE_SZ, 200*1024 /* minimal amount of bytes */);
+#endif
return true;
}
close(file_descriptors[0]);