winpr/thread: don't close invalid file descriptors
In case the file descriptor is -1 don't call close.
This commit is contained in:
parent
4250f3f030
commit
c3ea07f3d9
@ -504,10 +504,10 @@ void cleanup_handle(void *obj)
|
||||
WLog_ERR(TAG, "failed to destroy mutex [%d] %s (%d)",
|
||||
rc, strerror(errno), errno);
|
||||
|
||||
if (thread->pipe_fd[0])
|
||||
if (thread->pipe_fd[0] >= 0)
|
||||
close(thread->pipe_fd[0]);
|
||||
|
||||
if (thread->pipe_fd[1])
|
||||
if (thread->pipe_fd[1] >= 0)
|
||||
close(thread->pipe_fd[1]);
|
||||
|
||||
if (thread_list && ListDictionary_Contains(thread_list, &thread->thread))
|
||||
|
Loading…
Reference in New Issue
Block a user