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
This commit is contained in:
committed by
GitHub
parent
ab07fb8968
commit
ccaa714a85
@@ -57,7 +57,9 @@ bool NgxEventConnection::Init(ngx_cycle_t* cycle) {
|
|||||||
// See https://github.com/pagespeed/ngx_pagespeed/issues/1380
|
// See https://github.com/pagespeed/ngx_pagespeed/issues/1380
|
||||||
// TODO(oschaaf): Consider implementing a queueing mechanism for retrying
|
// TODO(oschaaf): Consider implementing a queueing mechanism for retrying
|
||||||
// failed writes.
|
// failed writes.
|
||||||
|
#ifdef F_SETPIPE_SZ
|
||||||
fcntl(pipe_write_fd_, F_SETPIPE_SZ, 200*1024 /* minimal amount of bytes */);
|
fcntl(pipe_write_fd_, F_SETPIPE_SZ, 200*1024 /* minimal amount of bytes */);
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
close(file_descriptors[0]);
|
close(file_descriptors[0]);
|
||||||
|
|||||||
Reference in New Issue
Block a user