httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: exit(1); return(child_pid);
Date Mon, 16 Jun 1997 15:45:54 GMT
Randy Terbush wrote:
> 
> > Jim Jagielski wrote:
> > > 
> > > I'm still under the opinion that it's ugly though and never returns
> > > a value at all under UNIX, no matter what happens. And under NT
> > > it's already returned a value... In any case, these functions which
> > > are called in spawn_child(_err) never return a value in UNIX and
> > > must in NT, yet the code makes it appear that, at first glance,
> > > it wants to return in both cases...
> > > 
> > 
> > Ugggg... Ignore this. The easiest and simplest fix is to remove the
> > exit(1) from the function and let spawn_child(_err) handle the exit
> > call. Thus, if it returns, then the exec didn't succeed and we
> > know that and spawn_child(_err) does the exit for us. I can't recall
> > if it does a exit(0) or exit(1) but IMO it should be exit(1).
> > 
> > Sound reasonable?
> 
> Having looked at this, it does not appear that we use the returned 
> value anyway. I think the return parameter in spawn_child(_err) needs to 
> change to void.
> 

Right now we don't since we do the exit() in the functions instead
of spawn_child_err(). However, if we don't do that, but simply
return, then we get the same behavior and the code is much cleaner
than typedefs and stuff like that. The only difference between
the NT and UNIX versions will be that the function will return
on both success and error for NT, but only error for UNIX.
By having it return, we could also have spawn_child_err() do
different things depending on what caused the error since we
could pass errno or whatever to it via the return value.

Clean and elegant.
-- 
====================================================================
      Jim Jagielski            |       jaguNET Access Services
     jim@jaguNET.com           |       http://www.jaguNET.com/
            "Look at me! I'm wearing a cardboard belt!"

Mime
View raw message