aboutsummaryrefslogtreecommitdiff
path: root/wpdf
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-06-28 16:32:50 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-06-28 16:32:50 +0200
commitdfd72df0ae0166b4c94a17bf8ca18954eff1132d (patch)
tree6d3edd78ea9a304e8377ed6c4c9ced406f619288 /wpdf
parentfbaed163427ca260d1e81ebfc8f513a90d73064d (diff)
downloadxutil-dfd72df0ae0166b4c94a17bf8ca18954eff1132d.tar.gz
wpdf: Return 0 on exit
Diffstat (limited to 'wpdf')
-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++;