summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-11-21 14:41:45 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-11-21 14:41:45 +0000
commite853c6a7170a3f5e5e06ad1f5771282e00b2f745 (patch)
tree63ce97dd74cfbee5fd085f9692df3294323d6f88
parentcde843d2ccc33019ceacff276c60c701d04ab8ac (diff)
downloadcontrol-center-e853c6a7170a3f5e5e06ad1f5771282e00b2f745.tar
control-center-e853c6a7170a3f5e5e06ad1f5771282e00b2f745.tar.gz
control-center-e853c6a7170a3f5e5e06ad1f5771282e00b2f745.tar.bz2
control-center-e853c6a7170a3f5e5e06ad1f5771282e00b2f745.tar.xz
control-center-e853c6a7170a3f5e5e06ad1f5771282e00b2f745.zip
restart logdrake on tool startup if needed
-rwxr-xr-xcontrol-center19
1 files 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/;