POSIX signal handling in xfdesktop
Benedikt Meurer
Benedikt.Meurer at unix-ag.uni-siegen.de
Wed Feb 26 15:33:58 CET 2003
On Wed, 26, Feb 2003, Benedikt Meurer wrote:
> The following patch makes xfdesktop use POSIX signal handling instead of
> depreceated ANSI-C signal handling.
Same with xfce4 panel.
regrads,
Benedikt
--
Those who do not understand Unix are condemned to reinvent it, poorly.
-- Henry Spencer
-------------- next part --------------
Index: panel/main.c
===================================================================
RCS file: /cvsroot/xfce/xfce-devel/xfce4/panel/main.c,v
retrieving revision 1.11
diff -u -r1.11 main.c
--- panel/main.c 14 Feb 2003 11:14:07 -0000 1.11
+++ panel/main.c 26 Feb 2003 14:32:47 -0000
@@ -142,6 +142,7 @@
int main(int argc, char **argv)
{
+ struct sigaction act;
int i;
gboolean net_wm_support = FALSE;
@@ -191,9 +192,16 @@
if(!(session_managed = session_init(client_session)))
g_message("%s: Running without session manager", PACKAGE);
- signal(SIGHUP, &sighandler);
- signal(SIGTERM, &sighandler);
- signal(SIGINT, &sighandler);
+ act.sa_handler = sighandler;
+ sigemptyset(&act.sa_mask);
+#ifdef SA_RESTART
+ act.sa_flags = SA_RESTART;
+#else
+ act.sa_flags = 0;
+#endif
+ sigaction(SIGHUP, &act, NULL);
+ sigaction(SIGINT, &act, NULL);
+ sigaction(SIGTERM, &act, NULL);
/* icon framework: names and id's */
icons_init();
More information about the Xfce4-dev
mailing list