Hi,

I noticed that crm_mon doesn't exit immediately
when it receive SIGINT in mainloop.
It seems that SIGINT only kills sleep() function...
(Is this caused by something in G_main_add_SignalHandler()?
 Or anything else?)

So, I modified it to exit wait function
when it is interrupted by a signal.
This patch is for Heartbeat STABLE 2.1 (aae8d51d84ec).
I hope it isn't too late for Heartbeat2.1.4...


Regards,
Satomi Taniguchi
diff -r aae8d51d84ec crm/admin/crm_mon.c
--- a/crm/admin/crm_mon.c	Thu Jul 17 16:46:24 2008 +0200
+++ b/crm/admin/crm_mon.c	Fri Jul 18 11:35:50 2008 +0900
@@ -457,6 +457,7 @@
 wait_for_refresh(int offset, const char *prefix, int msec) 
 {
 	int lpc = msec / 1000;
+	struct timespec sleept = {1 , 0};
 
 	if(as_console == FALSE) {
 		timer_id = Gmain_timeout_add(msec, mon_timer_popped, NULL);
@@ -477,7 +478,9 @@
 			timer_id = Gmain_timeout_add(
 				1000, mon_timer_popped, NULL);
 		} else {
-			sleep(1);
+			if (nanosleep(&sleept, NULL) != 0) {
+				return;
+			}
 		}
 	}
 }
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to