Asfand Yar Qazi wrote the following on 15.12.2007 09:30 :
> --
>
> To see the problem, run the command, then press CTRL-C while it's
> running.  It will say "ARGH!  The child has not exited yet!"
>
> Inside the CHLD handler, exitstatus should be the valid exit status of
> the child process.

If I'm not mistaken, there's none because the child didn't call exit.

>   However, it is nil.  This is really really bad,
> because it seems to imply that the child signal, which is meant to be
> caught when a child exits, is being called while the child has NOT exited.
>   

Looking at Process::Status#exited? documentation it seems it only
returns true if the process actually exited on its own. Here dd dies
because of a SIGINT (calling $?.signaled? returns true).

I'm not familiar with the signal handling details, so the following is
no more than an educated guess.
I believe that depending on the actual implementation of the signal
handler you can get different reactions to a signal relative to exit
status. Either:
- the program aborts *in the signal handler* and don't return an exit
status,
- the signal handler is only used to modify internal structures and
doesn't abort the program right away. The normal course of the program
only checks for the exit condition so you get a delayed "normal" exit
controlled by a signal. In this case you get an exit status.

Lionel