open-src/xserver/xorg/popen-signal.patch
changeset 606 068c11b419c9
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xorg/popen-signal.patch	Thu Jan 15 12:55:00 2009 -0800
@@ -0,0 +1,51 @@
+From c9051b684b524549eab6d5b88ee3e195a6f6fbe8 Mon Sep 17 00:00:00 2001
+From: Alan Coopersmith <[email protected]>
+Date: Wed, 5 Nov 2008 18:25:57 -0800
+Subject: [PATCH] Use OsSignal in Popen/Pclose to avoid SysV signal() stupidity
+---
+ os/utils.c |    8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/os/utils.c b/os/utils.c
+index f0bb717..b100949 100644
+--- a/os/utils.c
++++ b/os/utils.c
+@@ -1393,7 +1393,7 @@ static struct pid {
+     int pid;
+ } *pidlist;
+ 
+-void (*old_alarm)(int) = NULL; /* XXX horrible awful hack */
++OsSigHandlerPtr old_alarm = NULL; /* XXX horrible awful hack */
+ 
+ pointer
+ Popen(char *command, char *type)
+@@ -1417,7 +1417,7 @@ Popen(char *command, char *type)
+     }
+ 
+     /* Ignore the smart scheduler while this is going on */
+-    old_alarm = signal(SIGALRM, SIG_IGN);
++    old_alarm = OsSignal(SIGALRM, SIG_IGN);
+     if (old_alarm == SIG_ERR) {
+       perror("signal");
+       return NULL;
+@@ -1428,7 +1428,7 @@ Popen(char *command, char *type)
+ 	close(pdes[0]);
+ 	close(pdes[1]);
+ 	xfree(cur);
+-	if (signal(SIGALRM, old_alarm) == SIG_ERR)
++	if (OsSignal(SIGALRM, old_alarm) == SIG_ERR)
+ 	  perror("signal");
+ 	return NULL;
+     case 0:	/* child */
+@@ -1605,7 +1605,7 @@ #endif
+     /* allow EINTR again */
+     OsReleaseSignals ();
+     
+-    if (old_alarm && signal(SIGALRM, old_alarm) == SIG_ERR) {
++    if (old_alarm && OsSignal(SIGALRM, old_alarm) == SIG_ERR) {
+       perror("signal");
+       return -1;
+     }
+-- 
+1.4.1
+