From 71073c19b6ba903b2fc95313afa8a548e6cc68cd Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Mon, 12 Jan 2015 15:25:01 +0100 Subject: [PATCH] Respect passed parameters in unix_socket --- libretroshare/src/pqi/pqinetwork.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/libretroshare/src/pqi/pqinetwork.cc b/libretroshare/src/pqi/pqinetwork.cc index 41f8f3315..5d5c35e8d 100644 --- a/libretroshare/src/pqi/pqinetwork.cc +++ b/libretroshare/src/pqi/pqinetwork.cc @@ -858,16 +858,14 @@ int unix_close(int fd) 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); - -/******************* WINDOWS SPECIFIC PART ******************/ -#ifdef WINDOWS_SYS // WINDOWS + int osock = socket(domain, type, protocol); +#ifdef WINDOWS_SYS #ifdef NET_DEBUG std::cerr << "unix_socket()" << std::endl; -#endif +#endif // NET_DEBUG if ((unsigned) osock == INVALID_SOCKET) { @@ -875,8 +873,8 @@ int unix_socket(int /*domain*/, int /*type*/, int /*protocol*/) osock = -1; errno = WinToUnixError(WSAGetLastError()); } -#endif -/******************* WINDOWS SPECIFIC PART ******************/ +#endif // WINDOWS_SYS + return osock; }