[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Another lintian release for squeeze?



Raphael Geissert <geissert@debian.org> writes:

> Heh, yeah. Those were terribly-chosen names but I lacked imagination
> that day :)  What do you suggest to use as names instead of fork() and
> exec()?

background() and run() maybe?

> what about the interface to reap jobs?

wait() seems fine there.  It's doing basically the same thing as
CORE::wait().

> Maybe wait(), when passed a hash ref, should return the value of the
> hash member that was reaped, when called in scalar context. In array
> context it should probably return the key, value pair.

Seems reasonable to me.

> It seems that the only way to achieve what I want requires wait() to:
> a) call CORE::wait() to get the pid and $? of the reaped process.
> b) call $cmd->pid() for every member of the hash it was passed to see which 
> of the processes was the one that finished. Needs to be done this way 
> because we could otherwise end up reaping more jobs, if waitpid($pid, 
> WNOHANG) was used.
> c) tell the $cmd object what the return status was. This requires a getter 
> and a setter to be added to the OO interface. The former should probably 
> refuse to set the return status if $self->wait() doesn't return -1.

Yup, that sounds right.

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>


Reply to: