From e853c6a7170a3f5e5e06ad1f5771282e00b2f745 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 21 Nov 2003 14:41:45 +0000 Subject: restart logdrake on tool startup if needed --- control-center | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/control-center b/control-center index 4b417276..6f92a17b 100755 --- a/control-center +++ b/control-center @@ -83,8 +83,6 @@ gtkflush(); #------------------------------------------------------------- -# we'll show log only once and don't restart it with new embedded process -my $freeze_log = 1; my $still_in_splash_screen = 1; @@ -692,12 +690,6 @@ sub update_exp() { } } -sub reap_zombies { - my $child_pid; - do { $child_pid = waitpid(-1, POSIX::WNOHANG) } until $child_pid > 0; -} - - #------------------------------------------------------------- # signals managment @@ -723,6 +715,14 @@ my @pid_launched; # logdrake pid are stocked here my $pid_exp; +sub reap_zombies { + my $child_pid; + do { + $child_pid = waitpid(-1, POSIX::WNOHANG); + undef $pid_exp if $pid_exp eq $child_pid; + } until $child_pid > 0; +} + sub fork_ { my ($prog, $o_pid_table) = @_; @@ -789,12 +789,11 @@ sub compute_exec_string { # } # } # (re)start logdrake if needed - if ($option_values{show_log} && $freeze_log) { #FIXME && !$exp_socket + if ($option_values{show_log} && !$pid_exp) { #FIXME && !$exp_socket my $exp_socket; gtkshow(gtkadd($exp_frame, $exp_socket = Gtk2::Socket->new)); $w_exp->show; my $exec_log = "logdrake --explain=$log_exp --embedded " . $exp_socket->window->XWINDOW; - $freeze_log = 0; $pid_exp = fork_($exec_log, []); } $w_exp->hide if $embedded && $exec =~ /^drakfont|drakconnect|logdrake/; -- cgit v1.2.1