On Tue, Feb 11, 2014 at 8:07 AM, Ben Pfaff <b...@nicira.com> wrote:
> On Mon, Feb 10, 2014 at 03:25:36PM -0800, Gurucharan Shetty wrote:
>> This is helpful if we want to wait either on 'fd' for POSIX or
>> events for Windows.
>>
>> For Windows, if both 'fd' and 'wevent' is specified, we associate
>> that event with the 'fd' using WSAEventSelect() in poll_block().
>> So any 'events' on that 'fd' will wake us up from WaitForMultipleObjects().
>>
>> WSAEventSelect() does not understand  POLLIN, POLLOUT etc.  Instead the
>> macros it understands are FD_READ, FD_ACCEPT, FD_CONNECT, FD_CLOSE etc.
>> So we need to make that transition.
>>
>> CC: Linda Sun <l...@vmware.com>
>> Signed-off-by: Gurucharan Shetty <gshe...@nicira.com>
>
> ...
>
>>  #ifdef _WIN32
>>          wevents[i] = node->wevent;
>> +        if (node->pollfd.fd && node->wevent) {
>> +            short int wsa_events = 0;
>
> This "if" condition is always true, the | should be &.  Also in the
> second if statement:
Ugh. Thanks. I will fix it and push.
>> +            if (node->pollfd.events | POLLIN) {
>> +                wsa_events |= FD_READ | FD_ACCEPT | FD_CLOSE;
>> +            }
>> +            if (node->pollfd.events | POLLOUT) {
>> +                wsa_events |= FD_WRITE | FD_CONNECT | FD_CLOSE;
>> +            }
>> +            WSAEventSelect(node->pollfd.fd, node->wevent, wsa_events);
>> +        }
>>  #endif
>>          i++;
>>      }
>
> Otherwise:
> Acked-by: Ben Pfaff <b...@nicira.com>
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to