libwinpr-synch: fix broken FD_ISSET check caused by hidden type cast from int to...
authorMarc-André Moreau <marcandre.moreau@gmail.com>
Fri, 18 Sep 2015 15:38:27 +0000 (11:38 -0400)
committerMarc-André Moreau <marcandre.moreau@gmail.com>
Fri, 18 Sep 2015 15:38:27 +0000 (11:38 -0400)
winpr/libwinpr/synch/wait.c

index 7891e85..3192b43 100644 (file)
@@ -479,9 +479,9 @@ DWORD WaitForMultipleObjects(DWORD nCount, const HANDLE *lpHandles, BOOL bWaitAl
                        signal_set = pollfds[index].revents & pollfds[index].events;
 #else
                        if (Object->Mode & WINPR_FD_READ)
-                               signal_set = FD_ISSET(fd, &rfds);
+                               signal_set = FD_ISSET(fd, &rfds) ? 1 : 0;
                        if (Object->Mode & WINPR_FD_WRITE)
-                               signal_set = FD_ISSET(fd, &wfds);
+                               signal_set |= FD_ISSET(fd, &wfds) ? 1 : 0;
 #endif
                        if (signal_set)
                        {