m4-commit
[Top][All Lists]
Advanced

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

Changes to m4/src/stackovf.c,v [branch-1_4]


From: Eric Blake
Subject: Changes to m4/src/stackovf.c,v [branch-1_4]
Date: Thu, 03 Aug 2006 12:21:36 +0000

CVSROOT:        /sources/m4
Module name:    m4
Branch:         branch-1_4
Changes by:     Eric Blake <ericb>      06/08/03 12:21:35

Index: src/stackovf.c
===================================================================
RCS file: /sources/m4/m4/src/stackovf.c,v
retrieving revision 1.1.1.1.2.4
retrieving revision 1.1.1.1.2.5
diff -u -b -r1.1.1.1.2.4 -r1.1.1.1.2.5
--- src/stackovf.c      28 Jul 2006 20:39:37 -0000      1.1.1.1.2.4
+++ src/stackovf.c      3 Aug 2006 12:21:35 -0000       1.1.1.1.2.5
@@ -346,8 +346,17 @@
     ss.ss_sp = xmalloc ((unsigned) ss.ss_size);
     ss.ss_flags = 0;
     if (sigaltstack (&ss, NULL) < 0)
+      {
+       /* Oops - sigaltstack exists but doesn't work.  We can't
+          install the overflow detector, but should gracefully treat
+          it as though sigaltstack doesn't exist.  For example, this
+          happens when compiled with Linux 2.1 headers but run
+          against Linux 2.0 kernel.  */
+       if (errno == ENOSYS)
+         return;
       error (EXIT_FAILURE, errno, "sigaltstack");
   }
+  }
 
 #elif HAVE_SIGSTACK
 
@@ -358,8 +367,17 @@
     ss.ss_sp = stackbuf + SIGSTKSZ;
     ss.ss_onstack = 0;
     if (sigstack (&ss, NULL) < 0)
+      {
+       /* Oops - sigstack exists but doesn't work.  We can't install
+          the overflow detector, but should gracefully treat it as
+          though sigstack doesn't exist.  For example, this happens
+          when compiled with Linux 2.1 headers but run against Linux
+          2.0 kernel.  */
+       if (errno == ENOSYS)
+         return;
       error (EXIT_FAILURE, errno, "sigstack");
   }
+  }
 
 #else /* not HAVE_SIGSTACK */
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]