[Cluster-devel] cluster/cman/qdisk score.c

[email protected] <[email protected]>
Newsgroups com.redhat.cluster-devel
Message-ID <[email protected]>
CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL51
Changes by:	lhh at sourceware.org	2008-01-29 21:26:39

Modified files:
	cman/qdisk     : score.c 

Log message:
	Fix #430574 - qdisk blocking signals in heuristics

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/qdisk/score.c.diff?cvsroot=cluster&only_with_tag=RHEL51&r1=1.2.4.3&r2=1.2.4.3.2.1

--- cluster/cman/qdisk/score.c	2007/03/20 19:37:04	1.2.4.3
+++ cluster/cman/qdisk/score.c	2008/01/29 21:26:38	1.2.4.3.2.1
@@ -75,6 +75,24 @@
 
 
 /**
+  Set all signal handlers to default for exec of a script.
+  ONLY do this after a fork().
+ */
+void
+restore_signals(void)
+{
+	sigset_t set;
+	int x;
+
+	for (x = 1; x < _NSIG; x++)
+		signal(x, SIG_DFL);
+
+	sigfillset(&set);
+	sigprocmask(SIG_UNBLOCK, &set, NULL);
+}
+
+
+/**
   Spin off a user-defined heuristic
  */
 static int
@@ -117,6 +135,7 @@
 	 */
 	set_priority(SCHED_OTHER, -1);
 	munlockall();
+	restore_signals();
 
 	argv[0] = "/bin/sh";
 	argv[1] = "-c";
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.