diff options
author | John Ankarström <john@ankarstrom.se> | 2021-06-28 16:32:50 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-06-28 16:32:50 +0200 |
commit | dfd72df0ae0166b4c94a17bf8ca18954eff1132d (patch) | |
tree | 6d3edd78ea9a304e8377ed6c4c9ced406f619288 | |
parent | fbaed163427ca260d1e81ebfc8f513a90d73064d (diff) | |
download | xutil-dfd72df0ae0166b4c94a17bf8ca18954eff1132d.tar.gz |
wpdf: Return 0 on exit
-rwxr-xr-x | wpdf | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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++; |