From: Jeff Trawick Date: Tue, 20 Jun 2000 19:36:50 +0000 (+0000) Subject: ap_create_pipe was changed to return a pipe with both handles X-Git-Tag: APACHE_2_0_ALPHA_5~283 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=87e02199160958af948017166658a1b2833cf6b2;p=apache ap_create_pipe was changed to return a pipe with both handles blocking (previously, both handles were non-blocking). ap_set_pipe_timeout() is now the only way to manipulate the blocking state of the pipe. Pass -1 for timeout to make it blocking; pass 0 for timeout to make it non-blocking. ap_block_pipe() is gone. A few minor bugs were fixed along the way. OS-specific notes: non-Unix in general: Only Unix/BeOS currently has the optimization to keep track of the blocking state. This is used to avoid syscalls as well as to handle ap_put_os_file(), which is a case where we don't know the blocking state of the handle we are given. OS/2: ap_set_pipe_timeout() with timeout value > 0: The code didn't play with the blocking state before and it doesn't still. I did add logic for special timeout values 0 and -1 to play with the blocking state. ap_create_pipe(): old logic didn't do anything with the blocking state of the second handle; it still doesn't; hopefully it is blocking pre-BONE BEOS: old code to make a pipe non-blocking was a no-op; now it returns APR_ENOTIMPL BONE: old code to make a pipe non-blocking; it passed &zero as the parm to FIONBIO instead of &one; this bug was fixed Win32: The pipe was always created blocking before; no change previously, ap_setprocattr_io() ignored the blocking flag; now it respects it like other platforms and calls ap_set_pipe_timeout(p,0) on appropriate pipe handles (Bill Stoddard was just working in ap_set_pipe_timeout(), so I presume this is golden) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85637 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/log.c b/server/log.c index 53a97cbe9f..728d643b9f 100644 --- a/server/log.c +++ b/server/log.c @@ -705,12 +705,8 @@ API_EXPORT(piped_log *) ap_open_piped_log(ap_pool_t *p, const char *program) pl->program = ap_pstrdup(p, program); pl->pid = NULL; if (ap_create_pipe(&ap_piped_log_read_fd(pl), &ap_piped_log_write_fd(pl), p) != APR_SUCCESS) { - int save_errno = errno; - errno = save_errno; return NULL; } - ap_block_pipe(ap_piped_log_read_fd(pl)); - ap_block_pipe(ap_piped_log_write_fd(pl)); ap_register_cleanup(p, pl, piped_log_cleanup, piped_log_cleanup_for_exec); if (piped_log_spawn(pl) == -1) { int save_errno = errno;