diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2014-01-22 21:27:38 +0100 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2014-01-22 21:27:38 +0100 |
commit | 68ad5488ce52a01004db357c4bda2c77d87d4dbd (patch) | |
tree | 79b418a282497f945b2251a19873ebcaa7a8a094 /bin/net_applet | |
parent | 11271474a3beaa68a452f32d334526315e89cd8d (diff) | |
download | drakx-net-68ad5488ce52a01004db357c4bda2c77d87d4dbd.tar drakx-net-68ad5488ce52a01004db357c4bda2c77d87d4dbd.tar.gz drakx-net-68ad5488ce52a01004db357c4bda2c77d87d4dbd.tar.bz2 drakx-net-68ad5488ce52a01004db357c4bda2c77d87d4dbd.tar.xz drakx-net-68ad5488ce52a01004db357c4bda2c77d87d4dbd.zip |
block CHLD signals on startup in order to prevent glib-threading segfaults
Diffstat (limited to 'bin/net_applet')
-rwxr-xr-x | bin/net_applet | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/net_applet b/bin/net_applet index b8201f5..1844e36 100755 --- a/bin/net_applet +++ b/bin/net_applet @@ -2,7 +2,7 @@ use strict; -use POSIX ":sys_wait_h"; +use POSIX qw(:signal_h :sys_wait_h); use lib qw(/usr/lib/libDrakX); # i18n: IMPORTANT: to get correct namespace (drakx-net instead of libDrakX) BEGIN { unshift @::textdomains, 'drakx-net' } @@ -21,6 +21,7 @@ use dbus_object; use network::monitor; use network::signal_strength; use detect_devices; +BEGIN { POSIX::sigprocmask(SIG_BLOCK, POSIX::SigSet->new(SIGCHLD)); } use Gtk3::Notify -init, 'NetApplet'; use ugtk3 qw(:create :helpers :wrappers :dialogs); @@ -275,7 +276,11 @@ $SIG{USR1} = sub { }; # do not create zombies (#20552) -Glib::Timeout->add_seconds(1, sub { $SIG{CHLD} = \&harvester; 0; }); +Glib::Timeout->add_seconds(1, sub { + POSIX::sigprocmask(SIG_UNBLOCK, POSIX::SigSet->new(SIGCHLD)); + $SIG{CHLD} = \&harvester; + 0; + }); sub harvester { my $pid; do { |