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