$OpenBSD: patch-src_main_main_c,v 1.8 2014/09/02 14:55:37 dcoppa Exp $

OpenBSD always returns EINVAL when trying to disable an active stack

--- src/main/main.c.orig	Sat Jun 14 00:15:13 2014
+++ src/main/main.c	Sat Jun 14 16:14:58 2014
@@ -28,6 +28,8 @@
 #include <ctype.h>
 #include <stdlib.h>
 #include <string.h>
+#include <errno.h>
+#include <sys/errno.h>
 
 #define __MAIN__
 #define R_USE_SIGNALS 1
@@ -622,7 +624,8 @@ static void init_signal_handlers(void)
 	sigstk.ss_size = SIGSTKSZ + R_USAGE;
 	sigstk.ss_flags = 0;
 	if(sigaltstack(&sigstk, NULL) < 0)
-	    warning("failed to set alternate signal stack");
+	    if (errno != EINVAL) /* OpenBSD always returns EINVAL */
+	    	warning("failed to set alternate signal stack");
     } else
 	warning("failed to allocate alternate signal stack");
     sa.sa_sigaction = sigactionSegv;
