apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <jerenkra...@ebuilt.com>
Subject Re: [PATCH] Re: cvs commit: apr/threadproc/unix proc.c
Date Thu, 18 Oct 2001 18:36:36 GMT
On Thu, Oct 18, 2001 at 01:44:08PM -0400, Jeff Trawick wrote:
> Here is yet another patch.  When compared with the previous patch,
> this one adds the native status to the parameter lists of
> apr_proc_wait() and apr_proc_wait_all_procs().  Fewer MPM changes are
> necessary.
> 
> missing: fix the doc in apr_thread_proc.h
>          roll the changes into apr/threadproc/foo/proc.c, foo != unix
> 
> untested, but there isn't much to screw up
> 
> The interfaces are the important thing to look at.

Yeah.  Looks good except for one caveat (see below).

>          if (WIFEXITED(exit_int)) {
> -            if (exitcode != NULL) {
> -                *exitcode = WEXITSTATUS(exit_int);
> -            }
> -            return APR_CHILD_DONE;
> +            *exithow = APR_CHILD_NORMAL_EXIT;
> +            *exitcode_or_signal = WEXITSTATUS(exit_int);
> +        }
> +        else if (WIFSIGNALED(exit_int)) {
> +            *exithow = APR_CHILD_SIGNAL_EXIT;
> +            *exitcode_or_signal = WTERMSIG(exit_int);
> +        }
> +        else {
> +            /* unexpected condition */
> +            return APR_EGENERAL;
>          }
> -        return APR_CHILD_NOTDONE;
> +        return APR_CHILD_DONE;
>      }

I think WIFSTOPPED needs to be checked (do all platforms have this?
Linux does).  But, I'm not sure that should return APR_CHILD_DONE or
NOTDONE - since the process may resume later on.  This gets hairy.
Also, is returning APR_EGENERAL the right thing to do when we don't
recognize the exithow?  -- justin


Mime
View raw message