with Ingo's help:
* fixed the build of netfs under BONE/Dano by using the already existing build system defines instead of wrong checks for wether to use BONE headers * the client tried to bind to a non existing address for receiving broadcasts from the server (but the broadcasts are still not received, which will be worked on next) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21409 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
|
||||
#include <BeBuild.h>
|
||||
|
||||
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
|
||||
#ifdef HAIKU_TARGET_PLATFORM_BEOS
|
||||
//# define B_BAD_DATA -2147483632L
|
||||
#else
|
||||
# ifndef closesocket
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
|
||||
#ifdef HAIKU_TARGET_PLATFORM_BEOS
|
||||
# include <socket.h>
|
||||
#else
|
||||
# include <netinet/in.h>
|
||||
@@ -293,7 +293,7 @@ ServerManager::_BroadcastListener()
|
||||
sockaddr_in addr;
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons(kDefaultBroadcastPort);
|
||||
addr.sin_addr.s_addr = INADDR_BROADCAST;
|
||||
addr.sin_addr.s_addr = INADDR_ANY;
|
||||
int addrSize = sizeof(addr);
|
||||
BroadcastMessage message;
|
||||
//PRINT(("ServerManager::_BroadcastListener(): recvfrom()...\n"));
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
#ifndef NET_FS_INSECURE_CONNECTION_H
|
||||
#define NET_FS_INSECURE_CONNECTION_H
|
||||
|
||||
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
|
||||
#ifdef HAIKU_TARGET_PLATFORM_BEOS
|
||||
# include <socket.h>
|
||||
#else
|
||||
# include <netinet/in.h>
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
#ifndef NET_FS_NET_ADDRESS_H
|
||||
#define NET_FS_NET_ADDRESS_H
|
||||
|
||||
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
|
||||
#ifdef HAIKU_TARGET_PLATFORM_BEOS
|
||||
# include <socket.h>
|
||||
#else
|
||||
# include <netinet/in.h>
|
||||
|
||||
+7
-2
@@ -3,9 +3,10 @@
|
||||
#ifndef UTILS_H
|
||||
#define UTILS_H
|
||||
|
||||
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
|
||||
#ifdef HAIKU_TARGET_PLATFORM_BEOS
|
||||
# include <socket.h>
|
||||
#else
|
||||
# include <sys/socket.h>
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
@@ -26,8 +27,12 @@ void
|
||||
safe_closesocket(vint32& socketVar)
|
||||
{
|
||||
int32 socket = atomic_or(&socketVar, -1);
|
||||
if (socket >= 0)
|
||||
if (socket >= 0) {
|
||||
#ifndef HAIKU_TARGET_PLATFORM_BEOS
|
||||
shutdown(socket, SHUTDOWN_BOTH);
|
||||
#endif
|
||||
closesocket(socket);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // UTILS_H
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
#ifndef NET_FS_INSECURE_CONNECTION_LISTENER_H
|
||||
#define NET_FS_INSECURE_CONNECTION_LISTENER_H
|
||||
|
||||
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
|
||||
#ifdef HAIKU_TARGET_PLATFORM_BEOS
|
||||
# include <socket.h>
|
||||
#else
|
||||
# include <netinet/in.h>
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
|
||||
#ifdef HAIKU_TARGET_PLATFORM_BEOS
|
||||
# include <socket.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
@@ -1172,7 +1172,7 @@ NetFSServer::_Broadcaster()
|
||||
}
|
||||
|
||||
// set the socket broadcast option
|
||||
#if B_BEOS_VERSION > B_BEOS_VERSION_5
|
||||
#ifndef HAIKU_TARGET_PLATFORM_BEOS
|
||||
int soBroadcastValue = 1;
|
||||
if (setsockopt(fBroadcastingSocket, SOL_SOCKET, SO_BROADCAST,
|
||||
&soBroadcastValue, sizeof(soBroadcastValue)) < 0) {
|
||||
|
||||
+6
-6
@@ -423,10 +423,10 @@ SecurityContext::SecurityContext(BMessage* archive)
|
||||
BMessage permissionsArchive;
|
||||
if (archive->FindMessage("permissions", &permissionsArchive) != B_OK)
|
||||
return;
|
||||
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
|
||||
char* userName;
|
||||
#else
|
||||
#ifdef HAIKU_TARGET_PLATFORM_DANO
|
||||
const char* userName;
|
||||
#else
|
||||
char* userName;
|
||||
#endif
|
||||
type_code type;
|
||||
for (int32 userIndex = 0;
|
||||
@@ -442,10 +442,10 @@ SecurityContext::SecurityContext(BMessage* archive)
|
||||
return;
|
||||
|
||||
// got a user: iterate through its permissions
|
||||
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
|
||||
char* path;
|
||||
#else
|
||||
#ifdef HAIKU_TARGET_PLATFORM_DANO
|
||||
const char* path;
|
||||
#else
|
||||
char* path;
|
||||
#endif
|
||||
for (int32 i = 0;
|
||||
userArchive.GetInfo(B_INT32_TYPE, i, &path, &type) == B_OK;
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
|
||||
#ifdef HAIKU_TARGET_PLATFORM_BEOS
|
||||
# include <socket.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
@@ -30,7 +30,7 @@ InsecureChannel::InsecureChannel(int socket)
|
||||
int dontBlock = 0;
|
||||
setsockopt(fSocket, SOL_SOCKET, SO_NONBLOCK, &dontBlock, sizeof(int));
|
||||
|
||||
#if B_BEOS_VERSION > B_BEOS_VERSION_5
|
||||
#ifndef HAIKU_TARGET_PLATFORM_BEOS
|
||||
int txLowWater = 1;
|
||||
setsockopt(fSocket, SOL_SOCKET, SO_SNDLOWAT, &txLowWater, sizeof(int));
|
||||
setsockopt(fSocket, SOL_SOCKET, SO_RCVLOWAT, &txLowWater, sizeof(int));
|
||||
|
||||
@@ -21,9 +21,6 @@
|
||||
static const uint32 kMessageHeaderMagic = 'kMsG';
|
||||
static const int32 kMessageReallocChunkSize = 64;
|
||||
|
||||
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
|
||||
//# define B_BAD_DATA -2147483632L
|
||||
#endif
|
||||
#ifndef B_BUFFER_OVERFLOW
|
||||
# define B_BUFFER_OVERFLOW EOVERFLOW
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user