in reply to mod_perl, prefork mpm and alarms
if ((my $pid == fork()) == 0) { exec 'ghostscript', @args; } else { my $slept; while($slept++ < $alarmtime) { sleep 1; last unless kill 0, $pid; # see if it's still alive } kill 0, $pid or kill 15, $pid; wait; }
That way you wouldn't need signal handlers. Oh wait... SIGCHLD and the wait()...
--shmem
update: added loop
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|