diff src/tooltalk.c @ 420:41dbb7a9d5f2 r21-2-18

Import from CVS: tag r21-2-18
author cvs
date Mon, 13 Aug 2007 11:24:09 +0200
parents 697ef44129c6
children 11054d720c21
line wrap: on
line diff
--- a/src/tooltalk.c	Mon Aug 13 11:23:14 2007 +0200
+++ b/src/tooltalk.c	Mon Aug 13 11:24:09 2007 +0200
@@ -175,7 +175,7 @@
 
 DEFINE_LRECORD_IMPLEMENTATION ("tooltalk-message", tooltalk_message,
                                mark_tooltalk_message, print_tooltalk_message,
-                               0, 0, 0,
+                               0, 0, 0, 0,
 			       struct Lisp_Tooltalk_Message);
 
 static Lisp_Object
@@ -249,7 +249,7 @@
 
 DEFINE_LRECORD_IMPLEMENTATION ("tooltalk-pattern", tooltalk_pattern,
                                mark_tooltalk_pattern, print_tooltalk_pattern,
-                               0, 0, 0,
+                               0, 0, 0, 0,
 			       struct Lisp_Tooltalk_Pattern);
 
 static Lisp_Object
@@ -1256,7 +1256,28 @@
   Lisp_Object lp;
   Lisp_Object fil;
 
+
+  /* tt_open() messes with our signal handler flags (at least when no 
+     ttsessions is running on the machine), therefore we save the 
+     actions and restore them after the call */
+#ifdef HAVE_SIGPROCMASK
+  {
+    struct sigaction ActSIGQUIT;
+    struct sigaction ActSIGINT;
+    struct sigaction ActSIGCHLD;
+    sigaction (SIGQUIT, NULL, &ActSIGQUIT);
+    sigaction (SIGINT, NULL, &ActSIGINT);
+    sigaction (SIGCHLD, NULL, &ActSIGCHLD);
+#endif
   retval = tt_open ();
+#ifdef HAVE_SIGPROCMASK
+    sigaction (SIGQUIT, &ActSIGQUIT, NULL);
+    sigaction (SIGINT, &ActSIGINT, NULL);
+    sigaction (SIGCHLD, &ActSIGCHLD, NULL);
+  }
+#endif
+
+
   if (tt_ptr_error (retval) != TT_OK)
     return;