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