From e9828bbd25e905031618c888c7c32b9f34a88cb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 6 Oct 2006 13:17:00 +0000 Subject: [PATCH] * libnetapi.so should now work correctly in the R5 compatibility environment. * Added a link from libbnetapi.so to libnetapi.so. We might think about moving libnetapi.so into libnetwork.so as well. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19014 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/jam/HaikuImage | 1 + src/kits/network/libnetapi/NetEndpoint.cpp | 30 +--------------------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/build/jam/HaikuImage b/build/jam/HaikuImage index 6269649995..7f177697af 100644 --- a/build/jam/HaikuImage +++ b/build/jam/HaikuImage @@ -137,6 +137,7 @@ AddFilesToHaikuImage beos system lib : $(BEOS_SYSTEM_LIB) ; AddSymlinkToHaikuImage beos system lib : libnetwork.so : libsocket.so ; AddSymlinkToHaikuImage beos system lib : libnetwork.so : libbind.so ; AddSymlinkToHaikuImage beos system lib : libnetwork.so : libnet.so ; +AddSymlinkToHaikuImage beos system lib : libnetapi.so : libbnetapi.so ; # servers AddFilesToHaikuImage beos system servers : $(BEOS_SYSTEM_SERVERS) ; diff --git a/src/kits/network/libnetapi/NetEndpoint.cpp b/src/kits/network/libnetapi/NetEndpoint.cpp index 8b8719b575..df1fdf67b3 100644 --- a/src/kits/network/libnetapi/NetEndpoint.cpp +++ b/src/kits/network/libnetapi/NetEndpoint.cpp @@ -21,28 +21,6 @@ #include -static int -convert_r5_type(int type) -{ - // TODO: ideally, we should check if libnet.so has - // been loaded to activate this conversion. - // TODO: this is not enough, as the IPPROTO_* constants need to be translated as well - switch (type) { - case R5_SOCK_DGRAM: - return SOCK_DGRAM; - case R5_SOCK_STREAM: - return SOCK_STREAM; - case R5_SOCK_RAW: - return SOCK_RAW; - } - - return type; -} - - -// #pragma mark - BNetEndpoint - - BNetEndpoint::BNetEndpoint(int type) : fInit(B_NO_INIT), @@ -50,10 +28,7 @@ BNetEndpoint::BNetEndpoint(int type) fTimeout(B_INFINITE_TIMEOUT), fLastError(0) { - // Maintain R5 compatibility - type = convert_r5_type(type); - - if ((fSocket = socket(AF_INET, type, 0)) < 0) + if ((fSocket = socket(__gR5Compatibility ? R5_AF_INET : AF_INET, type, 0)) < 0) fLastError = errno; else fInit = B_OK; @@ -67,9 +42,6 @@ BNetEndpoint::BNetEndpoint(int family, int type, int protocol) fTimeout(B_INFINITE_TIMEOUT), fLastError(0) { - // Maintain R5 compatibility - type = convert_r5_type(type); - if ((fSocket = socket(family, type, protocol)) < 0) fLastError = errno; else