mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 17:09:34 -05:00
Merge pull request #155 from G10h4ck/huns_socket
Respect passed parameters in unix_socket
This commit is contained in:
commit
4b402a48a5
@ -858,16 +858,14 @@ int unix_close(int fd)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int unix_socket(int /*domain*/, int /*type*/, int /*protocol*/)
|
int unix_socket(int domain, int type, int protocol)
|
||||||
{
|
{
|
||||||
int osock = socket(PF_INET, SOCK_STREAM, 0);
|
int osock = socket(domain, type, protocol);
|
||||||
|
|
||||||
/******************* WINDOWS SPECIFIC PART ******************/
|
|
||||||
#ifdef WINDOWS_SYS // WINDOWS
|
|
||||||
|
|
||||||
|
#ifdef WINDOWS_SYS
|
||||||
#ifdef NET_DEBUG
|
#ifdef NET_DEBUG
|
||||||
std::cerr << "unix_socket()" << std::endl;
|
std::cerr << "unix_socket()" << std::endl;
|
||||||
#endif
|
#endif // NET_DEBUG
|
||||||
|
|
||||||
if ((unsigned) osock == INVALID_SOCKET)
|
if ((unsigned) osock == INVALID_SOCKET)
|
||||||
{
|
{
|
||||||
@ -875,8 +873,8 @@ int unix_socket(int /*domain*/, int /*type*/, int /*protocol*/)
|
|||||||
osock = -1;
|
osock = -1;
|
||||||
errno = WinToUnixError(WSAGetLastError());
|
errno = WinToUnixError(WSAGetLastError());
|
||||||
}
|
}
|
||||||
#endif
|
#endif // WINDOWS_SYS
|
||||||
/******************* WINDOWS SPECIFIC PART ******************/
|
|
||||||
return osock;
|
return osock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user