summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2017-08-25 11:52:09 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2017-08-25 14:20:59 +0200
commitd79d9193298b04246c18dcacd8b372518eb10ffc (patch)
tree83b910a5ee1d7b13df94c3d8be801091b97968ce
parentda9a8fdedc25645706ae198bad098f366351db58 (diff)
downloadlvm2-d79d9193298b04246c18dcacd8b372518eb10ffc.tar.gz
lvmlockd: log pthread_join errno code
Log possible errno with pthread_join (and one close() instance).
-rw-r--r--daemons/lvmlockd/lvmlockd-core.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/daemons/lvmlockd/lvmlockd-core.c b/daemons/lvmlockd/lvmlockd-core.c
index 253d86bbc..903da7c20 100644
--- a/daemons/lvmlockd/lvmlockd-core.c
+++ b/daemons/lvmlockd/lvmlockd-core.c
@@ -3539,11 +3539,15 @@ static int setup_worker_thread(void)
static void close_worker_thread(void)
{
+ int perrno;
+
pthread_mutex_lock(&worker_mutex);
worker_stop = 1;
pthread_cond_signal(&worker_cond);
pthread_mutex_unlock(&worker_mutex);
- pthread_join(worker_thread, NULL);
+
+ if ((perrno = pthread_join(worker_thread, NULL)))
+ log_error("pthread_join worker_thread error %d", perrno);
}
/* client_mutex is locked */
@@ -3769,7 +3773,8 @@ static int client_send_result(struct client *cl, struct action *act)
if (dump_fd >= 0) {
/* To avoid deadlock, send data here after the reply. */
send_dump_buf(dump_fd, dump_len);
- close(dump_fd);
+ if (close(dump_fd))
+ log_error("failed to close dump socket %d", dump_fd);
}
return rv;
@@ -4786,11 +4791,15 @@ static int setup_client_thread(void)
static void close_client_thread(void)
{
+ int perrno;
+
pthread_mutex_lock(&client_mutex);
client_stop = 1;
pthread_cond_signal(&client_cond);
pthread_mutex_unlock(&client_mutex);
- pthread_join(client_thread, NULL);
+
+ if ((perrno = pthread_join(client_thread, NULL)))
+ log_error("pthread_join client_thread error %d", perrno);
}
/*