diff options
-rw-r--r-- | Makefile | 5 | ||||
-rwxr-xr-x | control-center | 7 | ||||
-rw-r--r-- | wrapper | 30 |
3 files changed, 36 insertions, 6 deletions
@@ -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"); + } + +} |