Skip to content

Commit

Permalink
sd-resolve: simplify pthread_join() call
Browse files Browse the repository at this point in the history
POSIX says:
The pthread_join() function shall not return an error code of [EINTR].
  • Loading branch information
michich committed Nov 5, 2015
1 parent 6ff6f4d commit 5263a45
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/libsystemd/sd-resolve/sd-resolve.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,12 +584,8 @@ static void resolve_free(sd_resolve *resolve) {
}

/* Now terminate them and wait until they are gone. */
for (i = 0; i < resolve->n_valid_workers; i++) {
for (;;) {
if (pthread_join(resolve->workers[i], NULL) != EINTR)
break;
}
}
for (i = 0; i < resolve->n_valid_workers; i++)
pthread_join(resolve->workers[i], NULL);

/* Close all communication channels */
for (i = 0; i < _FD_MAX; i++)
Expand Down

0 comments on commit 5263a45

Please sign in to comment.