Re: perl fork exec

From: Scott Walde <scott_at_no.spam.please>
Date: Mon May 14 2007 - 16:46:46 CST

Hmmm... that breaks Inotify2. It seems that reaping the child closes my
inotify fd.

I'll check the cookbook when I get home.

Thanks anyways.

ttyl
srw

Steven Kurylo wrote:

> On 5/14/07, Scott Walde <scott@waldetech.ca> wrote:
>
>> How do I reap my dead children when using fork/exec in perl? I have it
>> working except for the defunct children.
>>
>> ttyl
>> srw
>
>
> The few times I've had to do it, I've always used the following, from
> the perl manual
>
> sub REAPER {
> $waitedpid = wait;
> $SIG{CHLD} = \&REAPER; # loathe sysV
> logmsg "reaped $waitedpid" . ($? ? " with exit $?" : '');
> }
>
> $SIG{CHLD} = \&REAPER;
>
> However the perl cookbook has a more robust method
>
> http://72.14.253.104/search?q=cache:MvvoYgfZDNMJ:www.unix.org.ua/orelly/perl/cookbook/ch16_20.ht
>
>
Received on Mon May 14 16:49:00 2007

This archive was generated by hypermail 2.1.8 : Mon May 14 2007 - 16:49:08 CST