From dfd72df0ae0166b4c94a17bf8ca18954eff1132d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Mon, 28 Jun 2021 16:32:50 +0200 Subject: wpdf: Return 0 on exit --- wpdf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'wpdf') 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++; -- cgit v1.2.3