Re: How to report a death by signal ?

2015-02-18 Thread Olivier Brunel
On 02/18/15 14:20, Laurent Bercot wrote: On 18/02/2015 14:04, Olivier Brunel wrote: I don't follow, what's wrong with using a fd? It needs a convention between G and P. And I can't do that, because G and P are not necessarily both execline commands. They are normal Unix programs, and the

Re: How to report a death by signal ?

2015-02-18 Thread Laurent Bercot
On 18/02/2015 14:55, Olivier Brunel wrote: But isn't the whole anything = 128 will be reported as 128, and anything higher is actually 128+signum also a convention that both needs to agree upon? Sure, but most commands exit 128 so that's reliable enough, and it's a lot easier to follow than

Re: How to report a death by signal ?

2015-02-18 Thread Laurent Bercot
On 18/02/2015 14:20, Peter Pentchev wrote: [roam@straylight ~]$ perl -e 'die(foo!\n);'; echo $? foo! 255 I think you should be ok, for the same reason why a shell is ok: if you're using Perl, you're most likely writing your whole script with it, especially control flow and error/crash

Re: How to report a death by signal ?

2015-02-18 Thread Laurent Bercot
On 18/02/2015 11:58, Peter Pentchev wrote: OK, so the not using the whole range of valid exit codes point rules out my obvious reply - do what the shell does - exit 128 + signum. Well the shell is happily ignoring the problem, but it doesn't mean it has solved it. The shell reserves a few

Re: How to report a death by signal ?

2015-02-18 Thread Laurent Bercot
On 18/02/2015 14:04, Olivier Brunel wrote: I don't follow, what's wrong with using a fd? It needs a convention between G and P. And I can't do that, because G and P are not necessarily both execline commands. They are normal Unix programs, and the whole point of execline is to have commands

Re: How to report a death by signal ?

2015-02-18 Thread Peter Pentchev
On Wed, Feb 18, 2015 at 01:58:34PM +0100, Laurent Bercot wrote: I'm leaning more and more towards the following approach: - child crashed: exit 128 + signal number - child exited with 128 or more: exit 128 - else: exit the child's exit code. Assuming normal commands never exit more

Re: How to report a death by signal ?

2015-02-18 Thread Laurent Bercot
I'm leaning more and more towards the following approach: - child crashed: exit 128 + signal number - child exited with 128 or more: exit 128 - else: exit the child's exit code. Assuming normal commands never exit more than 127, that reports the whole information to the immediate parent,