mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
gsocket: don't abuse GPollFD.revents field
We are reusing the GPollFD.revents field of the source to store a temporary value. Use a local variable for that instead. This is a refactor to make the next commit easier to understand. https://bugzilla.gnome.org/show_bug.cgi?id=724707
This commit is contained in:
parent
ff96f88e17
commit
1f7100506a
@ -3259,17 +3259,19 @@ socket_source_dispatch (GSource *source,
|
||||
GSocketSourceFunc func = (GSocketSourceFunc)callback;
|
||||
GSocketSource *socket_source = (GSocketSource *)source;
|
||||
GSocket *socket = socket_source->socket;
|
||||
guint events;
|
||||
gboolean ret;
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
socket_source->pollfd.revents = update_condition (socket_source->socket);
|
||||
events = update_condition (socket_source->socket);
|
||||
#else
|
||||
events = socket_source->pollfd.revents;
|
||||
#endif
|
||||
if (socket_source->socket->priv->timed_out)
|
||||
socket_source->pollfd.revents |= socket_source->condition & (G_IO_IN | G_IO_OUT);
|
||||
|
||||
ret = (*func) (socket,
|
||||
socket_source->pollfd.revents & socket_source->condition,
|
||||
user_data);
|
||||
if (socket_source->socket->priv->timed_out)
|
||||
events |= socket_source->condition & (G_IO_IN | G_IO_OUT);
|
||||
|
||||
ret = (*func) (socket, events & socket_source->condition, user_data);
|
||||
|
||||
if (socket->priv->timeout)
|
||||
socket_source->timeout_time = g_get_monotonic_time () +
|
||||
|
Loading…
Reference in New Issue
Block a user