Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
In the above, I would like to return the full $exitstatus so the monitor can know the reason the grandchild quit. One possibility, although I am unsure how unconventional, is to return ($returnvalue | $signalled). Any help is greatly appreciated.elsif ($pid == 0) { # .... my $exitstatus = ... my $returnvalue = $exitstatus >> 8; my $signalled = ($exitstatus & 127); print "status=$exitstatus, signal=$signalled\n"; return($returnvalue); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Exit codes and signals
by kennethk (Abbot) on Feb 06, 2016 at 15:14 UTC | |
by Anonymous Monk on Feb 06, 2016 at 18:48 UTC | |
|
Re: Exit codes and signals
by ikegami (Patriarch) on Feb 07, 2016 at 05:25 UTC | |
|
Re: Exit codes and signals
by Anonymous Monk on Feb 06, 2016 at 15:39 UTC |