From f3ffa19039b4f9faeea5cd7477863959b7af886c Mon Sep 17 00:00:00 2001 From: David Fort Date: Fri, 10 Jan 2020 17:11:50 +0100 Subject: [PATCH] winpr: don't close file descriptor if we set it again to the same file --- winpr/libwinpr/synch/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winpr/libwinpr/synch/event.c b/winpr/libwinpr/synch/event.c index ca00349b7..96164ff54 100644 --- a/winpr/libwinpr/synch/event.c +++ b/winpr/libwinpr/synch/event.c @@ -416,7 +416,7 @@ int SetEventFileDescriptor(HANDLE hEvent, int FileDescriptor, ULONG mode) event = (WINPR_EVENT*)Object; - if (!event->bAttached && event->pipe_fd[0] >= 0) + if (!event->bAttached && event->pipe_fd[0] >= 0 && event->pipe_fd[0] != FileDescriptor) close(event->pipe_fd[0]); event->bAttached = TRUE;