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
f6b6c94a
Commit
f6b6c94a
authored
Feb 25, 2018
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Feb 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Fix ioctlsocket(FIONREAD) with listening socket.
Signed-off-by:
Akihiro Sagawa
<
sagawa.aki@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
13b66d3d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
socket.c
dlls/ws2_32/socket.c
+12
-0
sock.c
dlls/ws2_32/tests/sock.c
+2
-2
No files found.
dlls/ws2_32/socket.c
View file @
f6b6c94a
...
@@ -4648,12 +4648,24 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID
...
@@ -4648,12 +4648,24 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID
case
WS_FIONREAD
:
case
WS_FIONREAD
:
{
{
#if defined(linux)
int
listening
=
0
;
socklen_t
len
=
sizeof
(
listening
);
#endif
if
(
out_size
!=
sizeof
(
WS_u_long
)
||
IS_INTRESOURCE
(
out_buff
))
if
(
out_size
!=
sizeof
(
WS_u_long
)
||
IS_INTRESOURCE
(
out_buff
))
{
{
SetLastError
(
WSAEFAULT
);
SetLastError
(
WSAEFAULT
);
return
SOCKET_ERROR
;
return
SOCKET_ERROR
;
}
}
if
((
fd
=
get_sock_fd
(
s
,
0
,
NULL
))
==
-
1
)
return
SOCKET_ERROR
;
if
((
fd
=
get_sock_fd
(
s
,
0
,
NULL
))
==
-
1
)
return
SOCKET_ERROR
;
#if defined(linux)
/* On Linux, FIONREAD on listening socket always fails (see tcp(7)).
However, it succeeds on native. */
if
(
!
getsockopt
(
fd
,
SOL_SOCKET
,
SO_ACCEPTCONN
,
&
listening
,
&
len
)
&&
listening
)
(
*
(
WS_u_long
*
)
out_buff
)
=
0
;
else
#endif
if
(
ioctl
(
fd
,
FIONREAD
,
out_buff
)
==
-
1
)
if
(
ioctl
(
fd
,
FIONREAD
,
out_buff
)
==
-
1
)
status
=
wsaErrno
();
status
=
wsaErrno
();
release_sock_fd
(
s
,
fd
);
release_sock_fd
(
s
,
fd
);
...
...
dlls/ws2_32/tests/sock.c
View file @
f6b6c94a
...
@@ -5233,8 +5233,8 @@ static void test_ioctlsocket(void)
...
@@ -5233,8 +5233,8 @@ static void test_ioctlsocket(void)
/* test FIONREAD with listening socket */
/* test FIONREAD with listening socket */
arg
=
0xdeadbeef
;
arg
=
0xdeadbeef
;
ret
=
ioctlsocket
(
sock
,
FIONREAD
,
&
arg
);
ret
=
ioctlsocket
(
sock
,
FIONREAD
,
&
arg
);
todo_wine
ok
(
ret
==
0
,
"ioctlsocket failed unexpectedly with error %d
\n
"
,
WSAGetLastError
());
ok
(
ret
==
0
,
"ioctlsocket failed unexpectedly with error %d
\n
"
,
WSAGetLastError
());
todo_wine
ok
(
arg
==
0
,
"expected 0, got %u
\n
"
,
arg
);
ok
(
arg
==
0
,
"expected 0, got %u
\n
"
,
arg
);
closesocket
(
sock
);
closesocket
(
sock
);
...
...
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