From db1450155e9f8a82130ec45fd4ade9a17f23a4f5 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 21 Feb 2002 10:00:36 +0000 Subject: smarter choosing of processes to kill --- perl-install/pkgs.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'perl-install/pkgs.pm') diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 0d93e3601..820f888a1 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -1420,6 +1420,7 @@ sub install($$$;$$) { } else { #- child process will run each transaction. $SIG{SEGV} = sub { log::l("segmentation fault on transactions"); c::_exit(0) }; + my @prev_pids = grep { /^\d+$/ } all("/proc"); my $db; eval { close INPUT; @@ -1477,7 +1478,7 @@ sub install($$$;$$) { close OUTPUT; #- now search for child process which may be locking the cdrom, making it unable to be ejected. - if (my @killpid = grep { $_ > $$ } all("/proc")) { + if (my @killpid = difference2([ grep { /^\d+$/ } all("/proc") ], \@prev_pids)) { log::l("ERROR: DrakX should not have to clean the packages shit. Killing ". join(", ", @killpid)); kill 15, @killpid; sleep 2; -- cgit v1.2.1