[PATCH 0/3] MR225: server: Fix races related to socket errors
Jinoh Kang (@iamahuman)
wine at gitlab.winehq.org
Fri Jun 10 11:53:21 CDT 2022
Jinoh Kang (@iamahuman) commented about server/sock.c:
> + if (getsockopt( get_unix_fd(sock->fd), SOL_SOCKET, SO_ERROR, (void *)error, &len) < 0)
> + return -1;
> +
> + if (sock->state == SOCK_CONNECTING)
> + {
> + if (*error)
> + sock->errors[AFD_POLL_BIT_CONNECT_ERR] = *error;
> + else
> + *error = sock->errors[AFD_POLL_BIT_CONNECT_ERR];
> + }
> + else if (sock->state == SOCK_LISTENING)
> + {
> + if (*error)
> + sock->errors[AFD_POLL_BIT_ACCEPT] = *error;
> + else
> + *error = sock->errors[AFD_POLL_BIT_CONNECT_ERR];
Do we want the following instead?
```suggestion:-0+0
*error = sock->errors[AFD_POLL_BIT_ACCEPT];
```
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/225#note_1853
More information about the wine-devel
mailing list