[Goodies-commits] r5406 - xfce4-mailwatch-plugin/trunk/panel-plugin
Brian Tarricone
kelnos at xfce.org
Mon Sep 15 06:41:16 CEST 2008
Author: kelnos
Date: 2008-09-15 04:41:16 +0000 (Mon, 15 Sep 2008)
New Revision: 5406
Modified:
xfce4-mailwatch-plugin/trunk/panel-plugin/mailwatch-plugin.c
Log:
set SIGUSR2 to SIG_IGN if setting a handler fails
Modified: xfce4-mailwatch-plugin/trunk/panel-plugin/mailwatch-plugin.c
===================================================================
--- xfce4-mailwatch-plugin/trunk/panel-plugin/mailwatch-plugin.c 2008-09-14 18:09:27 UTC (rev 5405)
+++ xfce4-mailwatch-plugin/trunk/panel-plugin/mailwatch-plugin.c 2008-09-15 04:41:16 UTC (rev 5406)
@@ -21,7 +21,7 @@
#include <config.h>
#endif
-#if defined(HAVE_SIGNAL_H) && defined(HAVE_XFCE_POSIX_SIGNAL_HANDLER_INIT)
+#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
@@ -1074,6 +1074,12 @@
{
XfceMailwatchPlugin *mwp;
GtkWidget *mi, *img;
+ struct sigaction sa = {
+ .sa_handler = SIG_IGN,
+#ifdef SA_RESTART
+ .sa_flags = SA_RESTART,
+#endif
+ };
xfce_textdomain(GETTEXT_PACKAGE, LOCALEDIR, "UTF-8");
@@ -1092,10 +1098,14 @@
{
g_warning("Failed to set SIGUSR2 handler: %s", error->message);
g_error_free(error);
+ sigaction(SIGUSR2, &sa, NULL);
}
} else
+#endif
+ {
g_warning("failed to init POSIX signal handler helper");
-#endif
+ sigaction(SIGUSR2, &sa, NULL);
+ }
g_signal_connect(plugin, "free-data",
G_CALLBACK(mailwatch_free), mwp);
More information about the Goodies-commits
mailing list