winsock_source->condition = condition;
add_condition_watch (socket, &winsock_source->condition);
- if (cancellable)
+ if (g_cancellable_make_pollfd (cancellable,
+ &winsock_source->cancel_pollfd))
{
winsock_source->cancellable = g_object_ref (cancellable);
- g_cancellable_make_pollfd (cancellable,
- &winsock_source->cancel_pollfd);
g_source_add_poll (source, &winsock_source->cancel_pollfd);
}
num_events = 0;
events[num_events++] = socket->priv->event;
- if (cancellable)
- {
- g_cancellable_make_pollfd (cancellable, &cancel_fd);
- events[num_events++] = (WSAEVENT)cancel_fd.fd;
- }
+ if (g_cancellable_make_pollfd (cancellable, &cancel_fd))
+ events[num_events++] = (WSAEVENT)cancel_fd.fd;
current_condition = update_condition (socket);
while ((condition & current_condition) == 0)
poll_fd[0].events = condition;
num = 1;
- if (cancellable)
- {
- g_cancellable_make_pollfd (cancellable, &poll_fd[1]);
- num++;
- }
+ if (g_cancellable_make_pollfd (cancellable, &poll_fd[1]))
+ num++;
do
result = g_poll (poll_fd, num, -1);