All of lore.kernel.org
 help / color / mirror / Atom feed
* master - daemons: check for non-zero thread_id
@ 2019-11-11 21:46 Zdenek Kabelac
  0 siblings, 0 replies; only message in thread
From: Zdenek Kabelac @ 2019-11-11 21:46 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1cc13335998558b84750fc2ba25c8b9f7b053746
Commit:        1cc13335998558b84750fc2ba25c8b9f7b053746
Parent:        cc865749ae443cca276ac411f302fd8989a843ef
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Fri Nov 8 13:10:49 2019 +0100
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Mon Nov 11 22:44:25 2019 +0100

daemons: check for non-zero thread_id

Do not call pthread_join if thread_id would be 0.
---
 libdaemon/server/daemon-server.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index b45c0e5..66e43d4 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -551,7 +551,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;
 			free(ts);




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-11 21:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-11 21:46 master - daemons: check for non-zero thread_id Zdenek Kabelac

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.