From 937bc54462464b119a6b978c0e4b79ff8b558814 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 15 Mar 2015 15:19:39 +0000 Subject: [PATCH] 0002 Respect passed params in unix socket (Patch from G10H4ck) git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.6-IPv6@8026 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- 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 b54408fd3..0ec2377c1 100644 --- a/libretroshare/src/pqi/pqinetwork.cc +++ b/libretroshare/src/pqi/pqinetwork.cc @@ -850,16 +850,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) { @@ -867,8 +865,8 @@ int unix_socket(int /*domain*/, int /*type*/, int /*protocol*/) osock = -1; errno = WinToUnixError(WSAGetLastError()); } -#endif -/******************* WINDOWS SPECIFIC PART ******************/ +#endif // WINDOWS_SYS + return osock; }