mirror of
git://sourceware.org/git/lvm2.git
synced 2025-02-28 05:57:49 +03:00
Fix last pthread_join fix commit
Call for pthread_join() does not set errno value even though return values looks like that. For now assign errno from return value and still use strerror() to print some error message as this seems to be commonly used. Add also log_sys_error() message for error close of local pipe.
This commit is contained in:
parent
96a20ae9d4
commit
ad9e16c198
@ -667,7 +667,8 @@ static int local_pipe_callback(struct local_client *thisfd, char *buf,
|
||||
/* EOF on pipe or an error, close it */
|
||||
if (len <= 0) {
|
||||
void *ret = &status;
|
||||
close(thisfd->fd);
|
||||
if (close(thisfd->fd))
|
||||
log_sys_error("close", "local_pipe");
|
||||
|
||||
/* Clear out the cross-link */
|
||||
if (thisfd->bits.pipe.client != NULL)
|
||||
@ -676,7 +677,8 @@ static int local_pipe_callback(struct local_client *thisfd, char *buf,
|
||||
|
||||
/* Reap child thread */
|
||||
if (thisfd->bits.pipe.threadid) {
|
||||
if (pthread_join(thisfd->bits.pipe.threadid, &ret))
|
||||
if ((errno = pthread_join(thisfd->bits.pipe.threadid,
|
||||
&ret)))
|
||||
log_sys_error("pthread_join", "");
|
||||
|
||||
thisfd->bits.pipe.threadid = 0;
|
||||
@ -1068,8 +1070,8 @@ static int read_from_local_sock(struct local_client *thisfd)
|
||||
pthread_cond_signal(&thisfd->bits.localsock.cond);
|
||||
pthread_mutex_unlock(&thisfd->bits.localsock.mutex);
|
||||
|
||||
if (pthread_join(thisfd->bits.localsock.threadid,
|
||||
(void **) &status))
|
||||
if ((errno = pthread_join(thisfd->bits.localsock.threadid,
|
||||
(void **) &status)))
|
||||
log_sys_error("pthread_join", "");
|
||||
|
||||
DEBUGLOG("Joined child thread\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user