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

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