Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b69eb168
Commit
b69eb168
authored
Apr 14, 2015
by
Bruno Jesus
Committed by
Alexandre Julliard
Apr 14, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Convert EBADF errno to ENOTSOCK.
parent
383ed3ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
16 deletions
+13
-16
socket.c
dlls/ws2_32/socket.c
+13
-16
No files found.
dlls/ws2_32/socket.c
View file @
b69eb168
...
...
@@ -863,7 +863,6 @@ static UINT sock_get_error( int err )
switch
(
err
)
{
case
EINTR
:
return
WSAEINTR
;
case
EBADF
:
return
WSAEBADF
;
case
EPERM
:
case
EACCES
:
return
WSAEACCES
;
case
EFAULT
:
return
WSAEFAULT
;
...
...
@@ -872,6 +871,7 @@ static UINT sock_get_error( int err )
case
EWOULDBLOCK
:
return
WSAEWOULDBLOCK
;
case
EINPROGRESS
:
return
WSAEINPROGRESS
;
case
EALREADY
:
return
WSAEALREADY
;
case
EBADF
:
case
ENOTSOCK
:
return
WSAENOTSOCK
;
case
EDESTADDRREQ
:
return
WSAEDESTADDRREQ
;
case
EMSGSIZE
:
return
WSAEMSGSIZE
;
...
...
@@ -2901,9 +2901,6 @@ int WINAPI WS_bind(SOCKET s, const struct WS_sockaddr* name, int namelen)
errno
=
loc_errno
;
switch
(
errno
)
{
case
EBADF
:
SetLastError
(
WSAENOTSOCK
);
break
;
case
EADDRNOTAVAIL
:
SetLastError
(
WSAEINVAL
);
break
;
...
...
@@ -3360,7 +3357,7 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
convert_sockopt
(
&
level
,
&
optname
);
if
(
getsockopt
(
fd
,
level
,
optname
,
optval
,
(
socklen_t
*
)
optlen
)
!=
0
)
{
SetLastError
(
(
errno
==
EBADF
)
?
WSAENOTSOCK
:
wsaErrno
());
SetLastError
(
wsaErrno
());
ret
=
SOCKET_ERROR
;
}
release_sock_fd
(
s
,
fd
);
...
...
@@ -3370,7 +3367,7 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
return
SOCKET_ERROR
;
if
(
getsockopt
(
fd
,
SOL_SOCKET
,
SO_ACCEPTCONN
,
optval
,
(
socklen_t
*
)
optlen
)
!=
0
)
{
SetLastError
(
(
errno
==
EBADF
)
?
WSAENOTSOCK
:
wsaErrno
());
SetLastError
(
wsaErrno
());
ret
=
SOCKET_ERROR
;
}
else
...
...
@@ -3467,7 +3464,7 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
if
(
getsockopt
(
fd
,
SOL_SOCKET
,
SO_LINGER
,
&
lingval
,
&
len
)
!=
0
)
{
SetLastError
(
(
errno
==
EBADF
)
?
WSAENOTSOCK
:
wsaErrno
());
SetLastError
(
wsaErrno
());
ret
=
SOCKET_ERROR
;
}
else
...
...
@@ -3519,7 +3516,7 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
return
SOCKET_ERROR
;
if
(
getsockopt
(
fd
,
SOL_SOCKET
,
SO_ERROR
,
optval
,
(
socklen_t
*
)
optlen
)
!=
0
)
{
SetLastError
(
(
errno
==
EBADF
)
?
WSAENOTSOCK
:
wsaErrno
());
SetLastError
(
wsaErrno
());
ret
=
SOCKET_ERROR
;
}
release_sock_fd
(
s
,
fd
);
...
...
@@ -3565,7 +3562,7 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
}
else
if
(
getsockopt
(
fd
,
SOL_SOCKET
,
SO_LINGER
,
&
lingval
,
&
len
)
!=
0
)
{
SetLastError
(
(
errno
==
EBADF
)
?
WSAENOTSOCK
:
wsaErrno
());
SetLastError
(
wsaErrno
());
ret
=
SOCKET_ERROR
;
}
else
...
...
@@ -3643,7 +3640,7 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
convert_sockopt
(
&
level
,
&
optname
);
if
(
getsockopt
(
fd
,
level
,
optname
,
&
tv
,
&
len
)
!=
0
)
{
SetLastError
(
(
errno
==
EBADF
)
?
WSAENOTSOCK
:
wsaErrno
());
SetLastError
(
wsaErrno
());
ret
=
SOCKET_ERROR
;
}
else
...
...
@@ -3668,7 +3665,7 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
if
(
getsockopt
(
fd
,
SOL_SOCKET
,
SO_TYPE
,
optval
,
(
socklen_t
*
)
optlen
)
!=
0
)
{
SetLastError
(
(
errno
==
EBADF
)
?
WSAENOTSOCK
:
wsaErrno
());
SetLastError
(
wsaErrno
());
ret
=
SOCKET_ERROR
;
}
else
...
...
@@ -3829,7 +3826,7 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
convert_sockopt
(
&
level
,
&
optname
);
if
(
getsockopt
(
fd
,
level
,
optname
,
optval
,
(
socklen_t
*
)
optlen
)
!=
0
)
{
SetLastError
(
(
errno
==
EBADF
)
?
WSAENOTSOCK
:
wsaErrno
());
SetLastError
(
wsaErrno
());
ret
=
SOCKET_ERROR
;
}
release_sock_fd
(
s
,
fd
);
...
...
@@ -3863,7 +3860,7 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
convert_sockopt
(
&
level
,
&
optname
);
if
(
getsockopt
(
fd
,
level
,
optname
,
optval
,
(
socklen_t
*
)
optlen
)
!=
0
)
{
SetLastError
(
(
errno
==
EBADF
)
?
WSAENOTSOCK
:
wsaErrno
());
SetLastError
(
wsaErrno
());
ret
=
SOCKET_ERROR
;
}
release_sock_fd
(
s
,
fd
);
...
...
@@ -3898,7 +3895,7 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
convert_sockopt
(
&
level
,
&
optname
);
if
(
getsockopt
(
fd
,
level
,
optname
,
optval
,
(
socklen_t
*
)
optlen
)
!=
0
)
{
SetLastError
(
(
errno
==
EBADF
)
?
WSAENOTSOCK
:
wsaErrno
());
SetLastError
(
wsaErrno
());
ret
=
SOCKET_ERROR
;
}
release_sock_fd
(
s
,
fd
);
...
...
@@ -4164,7 +4161,7 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID
}
if
((
fd
=
get_sock_fd
(
s
,
0
,
NULL
))
==
-
1
)
return
SOCKET_ERROR
;
if
(
ioctl
(
fd
,
FIONREAD
,
out_buff
)
==
-
1
)
status
=
(
errno
==
EBADF
)
?
WSAENOTSOCK
:
wsaErrno
();
status
=
wsaErrno
();
release_sock_fd
(
s
,
fd
);
break
;
}
...
...
@@ -4182,7 +4179,7 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID
/* SO_OOBINLINE sockets must always return TRUE to SIOCATMARK */
if
((
getsockopt
(
fd
,
SOL_SOCKET
,
SO_OOBINLINE
,
&
oob
,
&
oobsize
)
==
-
1
)
||
(
!
oob
&&
ioctl
(
fd
,
SIOCATMARK
,
&
atmark
)
==
-
1
))
status
=
(
errno
==
EBADF
)
?
WSAENOTSOCK
:
wsaErrno
();
status
=
wsaErrno
();
else
{
/* The SIOCATMARK value read from ioctl() is reversed
...
...
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