From b1f365c5c344d99b28f2210b636331ef4c20bae2 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 19 Mar 2003 13:03:21 +0000 Subject: properly *both* reap zombies and clear status bar message --- perl-install/standalone/harddrake2 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'perl-install/standalone') diff --git a/perl-install/standalone/harddrake2 b/perl-install/standalone/harddrake2 index cb9a48e41..54f683e64 100755 --- a/perl-install/standalone/harddrake2 +++ b/perl-install/standalone/harddrake2 @@ -9,6 +9,7 @@ use common; use ugtk2 qw(:create :helpers :wrappers); use interactive; use harddrake::data; #- needs to stay after use-ugtk2 as long as this module defines globals containing some N() +use POSIX qw(:sys_wait_h); # { field => [ short_translation, full_description] } @@ -298,7 +299,14 @@ foreach (@harddrake::data::tree) { $parent_iter->free; } -$SIG{CHLD} = sub { undef $pid; $statusbar->pop($sig_id) }; +$SIG{CHLD} = sub { + undef $pid; + $statusbar->pop($sig_id); + # reap zombies + my $child_pid; + do { $child_pid = waitpid(-1, POSIX::WNOHANG) } until $child_pid > 0; +}; + $w->{rwindow}->signal_connect(delete_event => \&quit_global); $w->{rwindow}->set_position('center') unless $::isEmbedded; @@ -321,7 +329,6 @@ $w->{rwindow}->show_all; undef $wait; gtkset_mousecursor_normal(); $_->hide foreach $module_cfg_button, $config_button; # hide buttons while no device -$SIG{CHLD} = 'IGNORE'; $w->main; -- cgit v1.2.1