[Ocfs2-tools-commits] bbarbe commits r911 - trunk/ocfs2_hb_ctl

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Mon May 23 19:31:05 CDT 2005


Author: bbarbe
Signed-off-by: mfasheh
Date: 2005-05-23 19:31:02 -0500 (Mon, 23 May 2005)
New Revision: 911

Modified:
   trunk/ocfs2_hb_ctl/ocfs2_hb_ctl.c
Log:
Blocking signals.
Signed-off-by: mfasheh


Modified: trunk/ocfs2_hb_ctl/ocfs2_hb_ctl.c
===================================================================
--- trunk/ocfs2_hb_ctl/ocfs2_hb_ctl.c	2005-05-23 23:42:16 UTC (rev 910)
+++ trunk/ocfs2_hb_ctl/ocfs2_hb_ctl.c	2005-05-24 00:31:02 UTC (rev 911)
@@ -24,9 +24,19 @@
 #include "ocfs2_hb_ctl.h"
 
 #include "o2cb.h"
+#include <signal.h>
 
 static char *progname = "ocfs2_hb_ctl";
 
+void block_signals (int how) {
+     sigset_t sigs;
+
+     sigfillset (&sigs);
+     sigdelset(&sigs, SIGTRAP);
+     sigdelset(&sigs, SIGSEGV);
+     sigprocmask (how, &sigs, (sigset_t *) 0);
+}
+
 static errcode_t get_uuid(char *dev, char *uuid)
 {
 	ocfs2_filesys *fs = NULL;
@@ -249,6 +259,8 @@
 		hbo.uuid_str = hbuuid;
 	}
 
+	block_signals(SIG_BLOCK);
+
 	switch(hbo.action) {
 	case HB_ACTION_USAGE:
 		ret = 0;
@@ -282,6 +294,7 @@
 	default:
 		abort();
 	}
+	block_signals(SIG_UNBLOCK);
 
 bail:
 	return ret ? 1 : 0;



More information about the Ocfs2-tools-commits mailing list