From mboxrd@z Thu Jan 1 00:00:00 1970 From: lhh@sourceware.org Date: 24 Jan 2008 14:58:39 -0000 Subject: [Cluster-devel] cluster/cman/qdisk score.c Message-ID: <20080124145839.22645.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: cluster Branch: RHEL4 Changes by: lhh at sourceware.org 2008-01-24 14:58:38 Modified files: cman/qdisk : score.c Log message: Unblock signals after fork() so heuristics using signals don't hang Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/qdisk/score.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.4&r2=1.1.2.5 --- cluster/cman/qdisk/score.c 2007/03/20 19:36:14 1.1.2.4 +++ cluster/cman/qdisk/score.c 2008/01/24 14:58:38 1.1.2.5 @@ -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";