diff options
-rwxr-xr-x | control-center | 20 | ||||
-rw-r--r-- | drakconf.spec | 7 |
2 files changed, 18 insertions, 9 deletions
diff --git a/control-center b/control-center index e06491dc..0b6561ca 100755 --- a/control-center +++ b/control-center @@ -421,7 +421,7 @@ evil command line.")) ] $notebook_global->append_page($summary); -use POSIX qw(:sys_utsname_h :math_h sys_wait_h); +use POSIX qw(:sys_utsname_h :math_h :sys_wait_h :unistd_h); my (undef, $nodename, $release, undef, $machine) = POSIX::uname(); @@ -702,17 +702,23 @@ my @pid_exp; sub fork_ { my ($prog, $pid_table) = @_; $pid_table ||= \@pid_launched; - my $pid; - unless ($pid = fork()) { - splash_warning(N("cannot fork: %s", "$!")) unless defined $pid; - exec($prog); + my $pid = fork(); + if (defined $pid) { + !$pid and do { exec($prog) or POSIX::_exit(1) }; # immediate exit, else forked gtk+ object destructors will badly catch up parent mcc + push @$pid_table, $pid if $embedded; + } else { + splash_warning(N("cannot fork: %s", "$!")); + child_just_exited(); } - push @$pid_table, $pid if $embedded; } sub compute_exec_string { my ($icon, $log_exp, $exec_, $gtkplug, undef, $alternate) = @_; #($_[0], @{$_[1]}); my $exec = ref($exec_) ? $exec_->[0] : $exec_; + if (! -x first(split /\s+/, $exec)) { + splash_warning(N("cannot fork and exec \"%s\" since it is not executable", $exec)); + return; + } $exec .= " --summary" if $expert_wizard && $exec_ =~ /drakwizard/; if ($embedded && $gtkplug != -1) { # globally embedded and not "explicitely not embedded" $notebook_global->hide; @@ -773,7 +779,7 @@ sub launch_xapp { grep { /$name/ } <X>; }; my @before = &$find_windows(); - fork_("$exec"); + fork_($exec); my @after = &$find_windows(); require Time::HiRes; while (@after ne $xx + @before) { diff --git a/drakconf.spec b/drakconf.spec index 7b267a23..974a30b4 100644 --- a/drakconf.spec +++ b/drakconf.spec @@ -4,7 +4,7 @@ Summary: The Mandrake Control Center Name: drakconf Version: 9.1 -Release: 6mdk +Release: 7mdk # get the source from our cvs repository (see # http://www.linuxmandrake.com/en/cvs.php3) Source0: %name-%version.tar.bz2 @@ -77,7 +77,7 @@ rm -rf $RPM_BUILD_ROOT %files -f %{name}.lang %defattr(-,root,root) -%doc COPYING +%doc COPYING ChangeLog %config(noreplace) %ghost /etc/mcc.conf %config(noreplace) /etc/gnome-vfs-2.0/vfolders/* %_bindir/* @@ -93,6 +93,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Mar 7 2003 Thierry Vignaud <tvignaud@mandrakesoft.com> 9.1-7mdk +- make mcc more robust against fork()/exec() faillures + * Thu Mar 6 2003 Thierry Vignaud <tvignaud@mandrakesoft.com> 9.1-6mdk - hide explanations for logdrake too since it's too big - update translations |