]> granicus.if.org Git - apache/commitdiff
ap_create_pipe was changed to return a pipe with both handles
authorJeff Trawick <trawick@apache.org>
Tue, 20 Jun 2000 19:36:50 +0000 (19:36 +0000)
committerJeff Trawick <trawick@apache.org>
Tue, 20 Jun 2000 19:36:50 +0000 (19:36 +0000)
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

server/log.c

index 53a97cbe9fe9a8a747b5ce5d89b0e0dd53be939c..728d643b9f0ffd342438b35353298d19a844fea4 100644 (file)
@@ -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;