diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2018-01-05 21:08:24 +0100 |
---|---|---|
committer | Marian Csontos <mcsontos@redhat.com> | 2018-01-22 19:32:31 +0100 |
commit | 94a631461d2d17e1847d2e215bce297bb1a2b70d (patch) | |
tree | cbe444d6c3cbea488a6503e4c982ffaf70754dcc | |
parent | 00277d60e98409e493f6208f7f541f7b85ace91f (diff) | |
download | lvm2-94a631461d2d17e1847d2e215bce297bb1a2b70d.tar.gz |
dmeventd: add check for result code
Check result from pthread_kill.
(cherry picked from commit f41935909fec9eb8d64bc04530be2f38866f0b8e)
-rw-r--r-- | daemons/dmeventd/dmeventd.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c index 7ad7f81e8..8917422fc 100644 --- a/daemons/dmeventd/dmeventd.c +++ b/daemons/dmeventd/dmeventd.c @@ -754,6 +754,7 @@ static void *_timeout_thread(void *unused __attribute__((unused))) struct thread_status *thread; struct timespec timeout; time_t curr_time; + int ret; DEBUGLOG("Timeout thread starting."); pthread_cleanup_push(_exit_timeout, NULL); @@ -775,7 +776,10 @@ static void *_timeout_thread(void *unused __attribute__((unused))) } else { DEBUGLOG("Sending SIGALRM to Thr %x for timeout.", (int) thread->thread); - pthread_kill(thread->thread, SIGALRM); + ret = pthread_kill(thread->thread, SIGALRM); + if (ret && (ret != ESRCH)) + log_error("Unable to wakeup Thr %x for timeout: %s.", + (int) thread->thread, strerror(ret)); } _unlock_mutex(); } |