[PATCH v3 0/3] MR225: server: Fix races related to socket errors
Piotr Caban (@piotr)
wine at gitlab.winehq.org
Sat Jun 11 06:02:45 CDT 2022
On Sat Jun 11 00:00:13 2022 +0000, **** wrote:
> Zebediah Figura replied on the mailing list:
> ```
> On 6/10/22 12:33, Piotr Caban wrote:
> > -static inline int sock_error( struct fd *fd )
> > +static inline int sock_error( struct sock *sock, int *error )
> > {
> > - unsigned int optval = 0;
> > - socklen_t optlen = sizeof(optval);
> > + socklen_t len = sizeof(*error);
> >
> > - getsockopt( get_unix_fd(fd), SOL_SOCKET, SO_ERROR, (void *)
> &optval, &optlen);
> > - return optval;
> > + if (getsockopt( get_unix_fd(sock->fd), SOL_SOCKET, SO_ERROR,
> (void *)error, &len) < 0)
> > + return -1;
> I'd personally just throw away the getsockopt() return value check
> instead; it should never fail.
> ```
I've pushed version without error checking.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/225#note_1898
More information about the wine-devel
mailing list