[vte] pty: Use NSIG instead of SIGUNUSED



commit 97f645f2329a1ee9b2bf97454c4122ef8d382f61
Author: Christian Persch <chpe gnome org>
Date:   Thu Dec 10 18:42:18 2015 +0100

    pty: Use NSIG instead of SIGUNUSED
    
    ... and with a fallback to 8 * sizeof(sigset_t) if NSIG is undefined.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=759196

 src/pty.cc |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/pty.cc b/src/pty.cc
index 28d2c6d..deabf7c 100644
--- a/src/pty.cc
+++ b/src/pty.cc
@@ -68,6 +68,11 @@
 
 #include <glib/gi18n-lib.h>
 
+/* NSIG isn't in POSIX, so if it doesn't exist use this here. See bug #759196 */
+#ifndef NSIG
+#define NSIG (8 * sizeof(sigset_t))
+#endif
+
 #if defined(HAVE_POSIX_OPENPT) && defined(HAVE_GRANTPT) && defined(HAVE_UNLOCKPT)
 #define HAVE_UNIX98_PTY
 #endif
@@ -134,7 +139,7 @@ vte_pty_child_setup (VtePty *pty)
 
         /* Reset the handlers for all signals to their defaults.  The parent
          * (or one of the libraries it links to) may have changed one to be ignored. */
-        for (int n = 1; n < SIGUNUSED; n++)
+        for (int n = 1; n < NSIG; n++)
                 signal(n, SIG_DFL);
 
         int masterfd = priv->pty_fd;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]