Setting SIG{CHLD} to IGNORE in fork() changes result of system() call

2010-05-17 Thread Kelly Jones
These 3 lines of code: if (fork()) {sleep 10; exit(0);} $SIG{'CHLD'} = 'IGNORE'; exit(system("/usr/lib/nagios/plugins/check_ping -H google.com -w 500,20% -c 1000,40% 1> /tmp/stdout.txt 2> /tmp/stderr.txt; echo $? > /tmp/res.txt")); return "PING WARNING - Packet loss = 0%, RTA = 62.08 ms|rta=62.07

Re: Setting SIG{CHLD} to IGNORE in fork() changes result of system() call

2010-05-18 Thread C.DeRykus
On May 17, 12:35 pm, kelly.terry.jo...@gmail.com (Kelly Jones) wrote: > These 3 lines of code: > > if (fork()) {sleep 10; exit(0);} > $SIG{'CHLD'} = 'IGNORE'; > exit(system("/usr/lib/nagios/plugins/check_ping -H google.com -w > 500,20% -c 1000,40% 1> /tmp/stdout.txt 2> /tmp/stderr.txt; echo $? > >