Blame SOURCES/0043-RH-signal-waiter.patch

f20720
---
f20720
 libmultipath/waiter.c |    9 +++++++++
f20720
 multipathd/main.c     |    8 ++++++++
f20720
 2 files changed, 17 insertions(+)
f20720
f20720
Index: multipath-tools-130222/libmultipath/waiter.c
f20720
===================================================================
f20720
--- multipath-tools-130222.orig/libmultipath/waiter.c
f20720
+++ multipath-tools-130222/libmultipath/waiter.c
f20720
@@ -57,6 +57,7 @@ void stop_waiter_thread (struct multipat
f20720
 	thread = mpp->waiter;
f20720
 	mpp->waiter = (pthread_t)0;
f20720
 	pthread_cancel(thread);
f20720
+	pthread_kill(thread, SIGUSR2);
f20720
 }
f20720
 
f20720
 /*
f20720
@@ -65,6 +66,7 @@ void stop_waiter_thread (struct multipat
f20720
  */
f20720
 int waiteventloop (struct event_thread *waiter)
f20720
 {
f20720
+	sigset_t set, oldset;
f20720
 	int event_nr;
f20720
 	int r;
f20720
 
f20720
@@ -97,8 +99,15 @@ int waiteventloop (struct event_thread *
f20720
 	dm_task_no_open_count(waiter->dmt);
f20720
 
f20720
 	/* wait */
f20720
+	sigemptyset(&set);
f20720
+	sigaddset(&set, SIGUSR2);
f20720
+	pthread_sigmask(SIG_UNBLOCK, &set, &oldset);
f20720
+
f20720
+	pthread_testcancel();
f20720
 	r = dm_task_run(waiter->dmt);
f20720
+	pthread_testcancel();
f20720
 
f20720
+	pthread_sigmask(SIG_SETMASK, &oldset, NULL);
f20720
 	dm_task_destroy(waiter->dmt);
f20720
 	waiter->dmt = NULL;
f20720
 
f20720
Index: multipath-tools-130222/multipathd/main.c
f20720
===================================================================
f20720
--- multipath-tools-130222.orig/multipathd/main.c
f20720
+++ multipath-tools-130222/multipathd/main.c
f20720
@@ -1506,6 +1506,12 @@ sigusr1 (int sig)
f20720
 }
f20720
 
f20720
 static void
f20720
+sigusr2 (int sig)
f20720
+{
f20720
+	condlog(3, "SIGUSR2 received");
f20720
+}
f20720
+
f20720
+static void
f20720
 signal_init(void)
f20720
 {
f20720
 	sigset_t set;
f20720
@@ -1513,10 +1519,12 @@ signal_init(void)
f20720
 	sigemptyset(&set);
f20720
 	sigaddset(&set, SIGHUP);
f20720
 	sigaddset(&set, SIGUSR1);
f20720
+	sigaddset(&set, SIGUSR2);
f20720
 	pthread_sigmask(SIG_BLOCK, &set, NULL);
f20720
 
f20720
 	signal_set(SIGHUP, sighup);
f20720
 	signal_set(SIGUSR1, sigusr1);
f20720
+	signal_set(SIGUSR2, sigusr2);
f20720
 	signal_set(SIGINT, sigend);
f20720
 	signal_set(SIGTERM, sigend);
f20720
 	signal(SIGPIPE, SIG_IGN);