1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-28 02:50:41 +03:00

daemons: check for non-zero thread_id

Do not call pthread_join if thread_id would be 0.
This commit is contained in:
Zdenek Kabelac 2019-11-08 13:10:49 +01:00
parent e9b2148dab
commit bbdcdc12b2

View File

@ -560,7 +560,8 @@ static void _reap(daemon_state s, int waiting)
while (ts) {
if (waiting || !ts->active) {
if ((errno = pthread_join(ts->client.thread_id, &rv)))
if (ts->client.thread_id &&
(errno = pthread_join(ts->client.thread_id, &rv)))
ERROR(&s, "pthread_join failed: %s", strerror(errno));
last->next = ts->next;
dm_free(ts);