winpr: don't close file descriptor if we set it again to the same file

This commit is contained in:
David Fort
2020-01-10 17:11:50 +01:00
committed by akallabeth
parent 85984f3bd3
commit f3ffa19039

View File

@@ -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;