From ccaa714a85dd7b73d2b144e59167f4fa086ab53a Mon Sep 17 00:00:00 2001 From: Otto van der Schaaf Date: Mon, 27 Nov 2017 23:21:03 +0100 Subject: [PATCH] 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 --- src/ngx_event_connection.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ngx_event_connection.cc b/src/ngx_event_connection.cc index 1848f1b13..6ab88f9cd 100644 --- a/src/ngx_event_connection.cc +++ b/src/ngx_event_connection.cc @@ -57,7 +57,9 @@ bool NgxEventConnection::Init(ngx_cycle_t* cycle) { // 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]);