summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2002-11-27 09:31:12 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2002-11-27 09:31:12 +0000
commit3f1d4f0c99767cffbae434453e290ea409df471f (patch)
treec2cbe1bed32fa46a55afed4b2c40865263743086
parentcef0a94a40fadc4c473de1e65fce58a2057215f8 (diff)
downloadcontrol-center-3f1d4f0c99767cffbae434453e290ea409df471f.tar
control-center-3f1d4f0c99767cffbae434453e290ea409df471f.tar.gz
control-center-3f1d4f0c99767cffbae434453e290ea409df471f.tar.bz2
control-center-3f1d4f0c99767cffbae434453e290ea409df471f.tar.xz
control-center-3f1d4f0c99767cffbae434453e290ea409df471f.zip
- add a wrapper to prevent bad side effects of c-z
(aka sigstop/sigcont) on embedded apps in mcc - Gtk is already imported by my_gtk - documente sig_child()
-rw-r--r--Makefile5
-rwxr-xr-xcontrol-center7
-rw-r--r--wrapper30
3 files changed, 36 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index b007ab55..f85923d5 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,7 @@ all: drakconf
for d in $(SUBDIRS); do ( cd $$d ; make $@ ) ; done
drakconf:
- cp control-center drakconf
+ cp -l control-center drakconf
clean:
$(MAKE) -C po $@
@@ -23,7 +23,8 @@ install: all
install -d $(DESTDIR)/usr/{bin/,share/{icons,doc/$(NAME)-$(VERSION)}}
install -d $(DESTDIR)/usr/sbin
install -d $(DESTDIR)/$(mcc_dir)
- install -m755 $(NAME) $(DESTDIR)/usr/bin/
+ install -m755 $(NAME) $(DESTDIR)/usr/sbin/$(NAME).real
+ install -m755 wrapper $(DESTDIR)/usr/bin/$(NAME)
install -m755 clock.pl $(DESTDIR)/usr/sbin/
install -m755 menus_launcher.pl $(DESTDIR)/usr/sbin/
install -m755 print_launcher.pl $(DESTDIR)/usr/sbin/
diff --git a/control-center b/control-center
index 06ec6b36..65f70828 100755
--- a/control-center
+++ b/control-center
@@ -26,9 +26,6 @@ my $mcc_dir = "/usr/share/mcc";
my $themes_dir = "$mcc_dir/themes/";
my $_wizdir = "/usr/share/wizards";
-BEGIN { !$ENV{DISPLAY} || system('/usr/X11R6/bin/xtest 2>/dev/null') and exec ("/usr/sbin/drakxconf; reset") }
-
-use Gtk;
use lib qw(/usr/lib/libDrakX);
use standalone;
use common;
@@ -521,11 +518,13 @@ $SIG{CHLD} = \&sig_child;
$SIG{CONT} = sub { Gtk->main };
Gtk->main;
+# got when child go in zombie state
sub sig_child {
- wait;
+ wait; # reap zombies
return unless $left_locked;
kill('USR1', $$);
splash_warning(N("This program was abnomarly exited"));
+# Gtk->main
}
# got when finished
diff --git a/wrapper b/wrapper
new file mode 100644
index 00000000..1a18341b
--- /dev/null
+++ b/wrapper
@@ -0,0 +1,30 @@
+#!/usr/bin/perl
+# $Id$
+
+# Copyright (C) 1999-2002 MandrakeSoft
+# Damien Krotkine
+# Thierry Vignaud (tvignaud@mandrakesoft.com)
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+if (!$ENV{DISPLAY} || system('/usr/X11R6/bin/xtest')) {
+ exec ("/usr/sbin/drakxconf; reset");
+} else {
+ unless (my $pid = fork) {
+ print "cannot fork\n" unless defined $pid;
+ exec ("/usr/sbin/drakconf.real");
+ }
+
+}