aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xwpdf5
1 files changed, 3 insertions, 2 deletions
diff --git a/wpdf b/wpdf
index 5700bc4..a906c67 100755
--- a/wpdf
+++ b/wpdf
@@ -9,7 +9,8 @@ my $alive; # number of children alive
my %deptarget; # dependency => target
my $parent = $$; # pid of parent
-$SIG{HUP} = sub { kill 'INT', $parent if not --$alive };
+$SIG{USR1} = sub { kill 'HUP', 0 if not --$alive };
+$SIG{HUP} = sub { exit 0 };
# collect dependencies for given pdf files
for my $target (@ARGV) {
@@ -33,7 +34,7 @@ for my $target (@ARGV) {
close $f;
if (fork == 0) {
system 'xpdf', '-remote', "wpdf-$target", $target;
- kill 'HUP', $parent;
+ kill 'USR1', $parent;
exit;
}
$alive++;