Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
b2556a2c
Commit
b2556a2c
authored
Mar 29, 2015
by
Bruno Jesus
Committed by
Alexandre Julliard
Mar 30, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Ensure sockets in exceptfds get set when an error occurs.
parent
57e7a562
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
17 deletions
+3
-17
socket.c
dlls/ws2_32/socket.c
+1
-15
sock.c
dlls/ws2_32/tests/sock.c
+2
-2
No files found.
dlls/ws2_32/socket.c
View file @
b2556a2c
...
...
@@ -1124,15 +1124,6 @@ static char *strdup_lower(const char *str)
return
ret
;
}
static
inline
int
sock_error_p
(
int
s
)
{
unsigned
int
optval
;
socklen_t
optlen
=
sizeof
(
optval
);
getsockopt
(
s
,
SOL_SOCKET
,
SO_ERROR
,
(
void
*
)
&
optval
,
&
optlen
);
if
(
optval
)
WARN
(
"
\t
[%i] error: %d
\n
"
,
s
,
optval
);
return
optval
!=
0
;
}
/* Utility: get the SO_RCVTIMEO or SO_SNDTIMEO socket option
* from an fd and return the value converted to milli seconds
* or -1 if there is an infinite time out */
...
...
@@ -4545,12 +4536,7 @@ static void release_poll_fds( const WS_fd_set *readfds, const WS_fd_set *writefd
if
(
exceptfds
)
{
for
(
i
=
0
;
i
<
exceptfds
->
fd_count
;
i
++
,
j
++
)
if
(
fds
[
j
].
fd
!=
-
1
)
{
/* make sure we have a real error before releasing the fd */
if
(
!
sock_error_p
(
fds
[
j
].
fd
))
fds
[
j
].
revents
=
0
;
release_sock_fd
(
exceptfds
->
fd_array
[
i
],
fds
[
j
].
fd
);
}
if
(
fds
[
j
].
fd
!=
-
1
)
release_sock_fd
(
exceptfds
->
fd_array
[
i
],
fds
[
j
].
fd
);
}
}
...
...
dlls/ws2_32/tests/sock.c
View file @
b2556a2c
...
...
@@ -3437,8 +3437,10 @@ static void test_select(void)
}
ok
(
!
FD_ISSET
(
fdWrite
,
&
writefds
),
"FD should not be set
\n
"
);
todo_wine
{
ok
(
!
FD_ISSET
(
fdRead
,
&
exceptfds
),
"FD should not be set
\n
"
);
ok
(
!
FD_ISSET
(
fdWrite
,
&
exceptfds
),
"FD should not be set
\n
"
);
}
ok
((
listen
(
fdWrite
,
SOMAXCONN
)
==
SOCKET_ERROR
),
"listen did not fail
\n
"
);
ret
=
closesocket
(
fdWrite
);
...
...
@@ -3683,9 +3685,7 @@ todo_wine
FD_SET
(
fdWrite
,
&
exceptfds
);
select_timeout
.
tv_sec
=
2
;
/* requires more time to realize it will not connect */
ret
=
select
(
0
,
&
readfds
,
&
writefds
,
&
exceptfds
,
&
select_timeout
);
todo_wine
ok
(
ret
==
1
,
"expected 1, got %d
\n
"
,
ret
);
todo_wine
ok
(
FD_ISSET
(
fdWrite
,
&
exceptfds
),
"fdWrite socket is not in the set
\n
"
);
ok
(
select_timeout
.
tv_usec
==
250000
,
"select timeout should not have changed
\n
"
);
closesocket
(
fdWrite
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment