Commit 407f6ba5 authored by James Juran's avatar James Juran Committed by Alexandre Julliard

Print a more effective (and visible) error message when an application

can't create a socket with type == SOCK_RAW.
parent b82727b6
......@@ -1645,7 +1645,7 @@ SOCKET WINAPI WINSOCK_socket(INT af, INT type, INT protocol)
default: SetLastError(WSAEPROTOTYPE); return INVALID_SOCKET;
}
if ((sock = socket(af, type, protocol)) >= 0)
if ((sock = socket(af, type, protocol)) >= 0)
{
ws_socket* pnew = wsi_alloc_socket(pwsi, sock);
......@@ -1664,7 +1664,10 @@ SOCKET WINAPI WINSOCK_socket(INT af, INT type, INT protocol)
if (errno == EPERM) /* raw socket denied */
{
WARN(winsock, "WS_SOCKET: not enough privileges\n");
if (type == SOCK_RAW)
MSG("WARNING: Trying to create a socket of type SOCK_RAW, will fail unless running as root\n");
else
MSG("WS_SOCKET: not enough privileges to create socket, try running as root\n");
SetLastError(WSAESOCKTNOSUPPORT);
} else SetLastError(wsaErrno());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment