summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2014-01-22 21:27:38 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2014-01-22 21:27:38 +0100
commit68ad5488ce52a01004db357c4bda2c77d87d4dbd (patch)
tree79b418a282497f945b2251a19873ebcaa7a8a094
parent11271474a3beaa68a452f32d334526315e89cd8d (diff)
downloaddrakx-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
-rw-r--r--NEWS2
-rwxr-xr-xbin/net_applet9
2 files changed, 9 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index d38cbe6..00a3529 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- block CHLD signals on startup in order to prevent glib-threading segfaults
+
2.9
- delay setting SIG_CHLD handler
(thus preventing potential segfault on startup (mga#10289))
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 {