summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2006-04-07 15:05:16 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2006-04-07 15:05:16 +0000
commite33aea3225f78a79a680884c806065b361829b73 (patch)
treebc31911864c3e200a5398d08b7d6d52030cc2b2a
parentedf373530a51c701dbb15310a85a120b49ad8b43 (diff)
downloadmgaonline-e33aea3225f78a79a680884c806065b361829b73.tar
mgaonline-e33aea3225f78a79a680884c806065b361829b73.tar.gz
mgaonline-e33aea3225f78a79a680884c806065b361829b73.tar.bz2
mgaonline-e33aea3225f78a79a680884c806065b361829b73.tar.xz
mgaonline-e33aea3225f78a79a680884c806065b361829b73.zip
install SIGHUP handler earlier so that the applet supports a very high
restart frequency (only usefull for tests)
-rwxr-xr-xmdkapplet15
1 files changed, 8 insertions, 7 deletions
diff --git a/mdkapplet b/mdkapplet
index 237d1ae9..bfb45927 100755
--- a/mdkapplet
+++ b/mdkapplet
@@ -38,6 +38,14 @@ use mdkonline;
use Gtk2::TrayIcon;
use Gtk2::NotificationBubble;
+
+# POSIX unmasks the sigprocmask properly
+my $sigset = POSIX::SigSet->new;
+my $action = POSIX::SigAction->new('restart_applet',
+ $sigset,
+ &POSIX::SA_NODEFER);
+POSIX::sigaction(&POSIX::SIGHUP, $action);
+
if (!find { $_ eq '--auto-update' } @ARGV) {
my $pid = mdkonline::is_running('mdkapplet');
$pid and die "mdkapplet already running ($pid)\n";
@@ -166,13 +174,6 @@ $SIG{USR1} = 'IGNORE';
$SIG{USR2} = 'IGNORE';
$SIG{CHLD} = \&harvester;
-# POSIX unmasks the sigprocmask properly
-my $sigset = POSIX::SigSet->new;
-my $action = POSIX::SigAction->new('restart_applet',
- $sigset,
- &POSIX::SA_NODEFER);
-POSIX::sigaction(&POSIX::SIGHUP, $action);
-
Glib::Timeout->add(200, sub { harvester('CHLD', 1); 1 });
Gtk2->main;