I am using a Perl script to launch several execution of a process.
Child processes are created piped to the Perl script using a open(PIPE,"|$exe");
Then, I am waiting for the child to stop before launching next iteration of the process.
In case the child process is not terminating fine, I set a signal handler on the CHLD. This handler is the following:
" sub simu_ended{ wait(); if($? !=0) { print "Child signal did not terminate properly, exiting\n"; die; } else { # nothing to do, normal handler } } "
I have two issues with this system:
- 1 - on Solaris (and may be linux): since the two processes are sharing the stdin, when the script is executed without the "&" at the end of the unix command, if ever the user wants to interupt it with a ctrl-Z, the wait() in the above handler will return $?=-1 as if the child is already dead when the interruption is raised.
- 2 - on Linux: for an unknown reason, the wait() in the handler always return $?=-1 whatever happent to the child.
Any idea about these issues? Any clue or beginning of a solution?
Thanks
Antoine
_______________________________________________ Perl-Unix-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs