From 0d934e730ec62d16c4f47dbb0d8e97ed16910786 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 2 Nov 2018 22:11:18 +0100 Subject: [PATCH] cov: trace failing pthread_kill --- daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c b/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c index 6ffa9fc52..9e9053c0e 100644 --- a/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c +++ b/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c @@ -175,6 +175,7 @@ void process_event(struct dm_task *dmt, const char *device = dm_task_get_name(dmt); int percent; struct dm_info info; + int ret; /* No longer monitoring, waiting for remove */ if (!state->percent_check) @@ -205,7 +206,8 @@ void process_event(struct dm_task *dmt, /* Maybe configurable ? */ _remove(dm_task_get_uuid(dmt)); #endif - pthread_kill(pthread_self(), SIGALRM); + if ((ret = pthread_kill(pthread_self(), SIGALRM)) && (ret != ESRCH)) + log_sys_error("pthread_kill", "self"); goto out; } @@ -213,7 +215,8 @@ void process_event(struct dm_task *dmt, /* TODO eventually recognize earlier when room is enough */ log_info("Dropping monitoring of fully provisioned snapshot %s.", device); - pthread_kill(pthread_self(), SIGALRM); + if ((ret = pthread_kill(pthread_self(), SIGALRM)) && (ret != ESRCH)) + log_sys_error("pthread_kill", "self"); goto out; } -- 2.43.5