in reply to command timeout not working

You may want to implement this differently. Even if you can get the parent process to continue, you are not guaranteed that the child process will die when using alarm(), in fact it usually doesn't for me. You will probably need to kill it off with a signal from the parent. Note that this question has been asked many times before (see Super Search).

One simple workaround: I tend to fork the child which sends it's output to a temp file, wait in the parent with waitpid and then kill the child from the parent after the timeout expires. You can timeout the waitpid call with alarm() or just call it non-blocking and sleep a second or two between each call.