diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-12-06 11:38:03 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-12-06 11:38:13 +0100 |
commit | ec530530b7c4afbc7b521aaf05ac4e3d527fdf7e (patch) | |
tree | b7655ea40760ab5ba5b1dd38476b343178ca1187 | |
parent | 1d3a86cfb11b3490806444e70683a8fa1fa1487d (diff) |
Fix Linux-specific code
Change-Id: I36971b78dcc2fb0ab8570c8b80feb51bf6043e54
-rw-r--r-- | sd/source/ui/remotecontrol/BluetoothServer.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx b/sd/source/ui/remotecontrol/BluetoothServer.cxx index 255941708f1f..6ec590dce47c 100644 --- a/sd/source/ui/remotecontrol/BluetoothServer.cxx +++ b/sd/source/ui/remotecontrol/BluetoothServer.cxx @@ -316,16 +316,17 @@ void SAL_CALL BluetoothServer::run() socklen_t aRemoteAddrLen = sizeof(aRemoteAddr); while ( true ) { - SOCKET socket; + int bSocket; SAL_INFO( "sdremote.bluetooth", "waiting on accept" ); - if ( (socket = accept(aSocket, (sockaddr*) &aRemoteAddr, &aRemoteAddrLen)) == INVALID_SOCKET ) + if ( (bSocket = accept(aSocket, (sockaddr*) &aRemoteAddr, &aRemoteAddrLen)) < 0 ) { - SAL_WARN( "sdremote.bluetooth", "accept failed with error " << WSAGetLastError() ); + int err = errno; + SAL_WARN( "sdremote.bluetooth", "accept failed with errno " << err ); close( aSocket ); return; } else { SAL_INFO( "sdremote.bluetooth", "connection accepted" ); - Communicator* pCommunicator = new Communicator( new BufferedStreamSocket( socket ) ); + Communicator* pCommunicator = new Communicator( new BufferedStreamSocket( bSocket ) ); mpCommunicators->push_back( pCommunicator ); pCommunicator->launch(); } |