|
|
d6c8c5 |
From 94a631461d2d17e1847d2e215bce297bb1a2b70d Mon Sep 17 00:00:00 2001
|
|
|
d6c8c5 |
From: Zdenek Kabelac <zkabelac@redhat.com>
|
|
|
d6c8c5 |
Date: Fri, 5 Jan 2018 21:08:24 +0100
|
|
|
d6c8c5 |
Subject: [PATCH 17/25] dmeventd: add check for result code
|
|
|
d6c8c5 |
|
|
|
d6c8c5 |
Check result from pthread_kill.
|
|
|
d6c8c5 |
|
|
|
d6c8c5 |
(cherry picked from commit f41935909fec9eb8d64bc04530be2f38866f0b8e)
|
|
|
d6c8c5 |
---
|
|
|
d6c8c5 |
daemons/dmeventd/dmeventd.c | 6 +++++-
|
|
|
d6c8c5 |
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
|
d6c8c5 |
|
|
|
d6c8c5 |
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
|
|
|
d6c8c5 |
index 7ad7f81..8917422 100644
|
|
|
d6c8c5 |
--- a/daemons/dmeventd/dmeventd.c
|
|
|
d6c8c5 |
+++ b/daemons/dmeventd/dmeventd.c
|
|
|
d6c8c5 |
@@ -754,6 +754,7 @@ static void *_timeout_thread(void *unused __attribute__((unused)))
|
|
|
d6c8c5 |
struct thread_status *thread;
|
|
|
d6c8c5 |
struct timespec timeout;
|
|
|
d6c8c5 |
time_t curr_time;
|
|
|
d6c8c5 |
+ int ret;
|
|
|
d6c8c5 |
|
|
|
d6c8c5 |
DEBUGLOG("Timeout thread starting.");
|
|
|
d6c8c5 |
pthread_cleanup_push(_exit_timeout, NULL);
|
|
|
d6c8c5 |
@@ -775,7 +776,10 @@ static void *_timeout_thread(void *unused __attribute__((unused)))
|
|
|
d6c8c5 |
} else {
|
|
|
d6c8c5 |
DEBUGLOG("Sending SIGALRM to Thr %x for timeout.",
|
|
|
d6c8c5 |
(int) thread->thread);
|
|
|
d6c8c5 |
- pthread_kill(thread->thread, SIGALRM);
|
|
|
d6c8c5 |
+ ret = pthread_kill(thread->thread, SIGALRM);
|
|
|
d6c8c5 |
+ if (ret && (ret != ESRCH))
|
|
|
d6c8c5 |
+ log_error("Unable to wakeup Thr %x for timeout: %s.",
|
|
|
d6c8c5 |
+ (int) thread->thread, strerror(ret));
|
|
|
d6c8c5 |
}
|
|
|
d6c8c5 |
_unlock_mutex();
|
|
|
d6c8c5 |
}
|
|
|
d6c8c5 |
--
|
|
|
d6c8c5 |
1.8.3.1
|
|
|
d6c8c5 |
|