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
6733c40d
Commit
6733c40d
authored
Oct 18, 2010
by
Dan Kegel
Committed by
Alexandre Julliard
Oct 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Null select() should fail with WSAEINVAL.
parent
d95e2dbd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
socket.c
dlls/ws2_32/socket.c
+6
-2
sock.c
dlls/ws2_32/tests/sock.c
+11
-0
No files found.
dlls/ws2_32/socket.c
View file @
6733c40d
...
...
@@ -3496,7 +3496,11 @@ static struct pollfd *fd_sets_to_poll( const WS_fd_set *readfds, const WS_fd_set
if
(
writefds
)
count
+=
writefds
->
fd_count
;
if
(
exceptfds
)
count
+=
exceptfds
->
fd_count
;
*
count_ptr
=
count
;
if
(
!
count
)
return
NULL
;
if
(
!
count
)
{
SetLastError
(
WSAEINVAL
);
return
NULL
;
}
if
(
!
(
fds
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
*
sizeof
(
fds
[
0
]))))
{
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
...
...
@@ -3619,7 +3623,7 @@ int WINAPI WS_select(int nfds, WS_fd_set *ws_readfds,
TRACE
(
"read %p, write %p, excp %p timeout %p
\n
"
,
ws_readfds
,
ws_writefds
,
ws_exceptfds
,
ws_timeout
);
if
(
!
(
pollfds
=
fd_sets_to_poll
(
ws_readfds
,
ws_writefds
,
ws_exceptfds
,
&
count
))
&&
count
)
if
(
!
(
pollfds
=
fd_sets_to_poll
(
ws_readfds
,
ws_writefds
,
ws_exceptfds
,
&
count
)))
return
SOCKET_ERROR
;
if
(
ws_timeout
)
...
...
dlls/ws2_32/tests/sock.c
View file @
6733c40d
...
...
@@ -1943,6 +1943,17 @@ static void test_select(void)
FD_ZERO
(
&
readfds
);
FD_ZERO
(
&
writefds
);
FD_ZERO
(
&
exceptfds
);
SetLastError
(
0
);
ret
=
select
(
maxfd
+
1
,
0
,
0
,
0
,
&
select_timeout
);
ok
(
(
ret
==
SOCKET_ERROR
),
"expected SOCKET_ERROR, got %i
\n
"
,
ret
);
ok
(
GetLastError
()
==
WSAEINVAL
,
"expected WSAEINVAL, got %i
\n
"
,
ret
);
SetLastError
(
0
);
ret
=
select
(
maxfd
+
1
,
&
readfds
,
&
writefds
,
&
exceptfds
,
&
select_timeout
);
ok
(
(
ret
==
SOCKET_ERROR
),
"expected SOCKET_ERROR, got %i
\n
"
,
ret
);
ok
(
GetLastError
()
==
WSAEINVAL
,
"expected WSAEINVAL, got %i
\n
"
,
ret
);
FD_SET
(
INVALID_SOCKET
,
&
readfds
);
SetLastError
(
0
);
ret
=
select
(
maxfd
+
1
,
&
readfds
,
&
writefds
,
&
exceptfds
,
&
select_timeout
);
...
...
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