From 27aacefb20962680096bbb86b82006d19096f798 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 5 May 2005 18:59:55 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=6043 --- checkin_notes | 12 ++++++++++++ clientgui/BOINCGUIApp.cpp | 11 ++++++++--- lib/network.C | 7 ++++++- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/checkin_notes b/checkin_notes index 29275a1f85..b8f5745d10 100755 --- a/checkin_notes +++ b/checkin_notes @@ -6154,3 +6154,15 @@ David 5 May 2005 client/ client_state.C scheduler_op.C + +David 5 May 2005 + - fixes for FreeBSD from J.R. Oldroyd + - BOINC Manager: + Don't use BOINC_DIAG_REDIRECTSTDERR and BOINC_DIAG_REDIRECTSTDOUT + on non-Windows + IsBOINCCoreRunning(): close RPC connection + + clientgui/ + BOINCGUIApp.cpp + lib/ + network.C diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index ef64c14370..728cfca357 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -110,8 +110,10 @@ bool CBOINCGUIApp::OnInit() { BOINC_DIAG_DUMPCALLSTACKENABLED | BOINC_DIAG_HEAPCHECKENABLED | BOINC_DIAG_MEMORYLEAKCHECKENABLED | +#ifdef _WIN32 BOINC_DIAG_REDIRECTSTDERR | BOINC_DIAG_REDIRECTSTDOUT | +#endif BOINC_DIAG_TRACETOSTDOUT; diagnostics_init( @@ -334,12 +336,15 @@ void CBOINCGUIApp::InitSupportedLanguages() { bool CBOINCGUIApp::IsBOINCCoreRunning() { wxLogTrace(wxT("Function Start/End"), wxT("CBOINCGUIApp::IsBOINCCoreRunning - Function Begin")); - bool retval; + int retval; + bool running; RPC_CLIENT rpc; - retval = (0 == rpc.init( wxT("localhost") ) ); + retval = rpc.init("localhost", false); // synchronous is OK since local + running = (retval == 0); + rpc.close(); wxLogTrace(wxT("Function Start/End"), wxT("CBOINCGUIApp::IsBOINCCoreRunning - Function End")); - return retval; + return running; } diff --git a/lib/network.C b/lib/network.C index 974ccd2ef9..4b558bd475 100644 --- a/lib/network.C +++ b/lib/network.C @@ -166,8 +166,13 @@ int get_socket_error(int fd) { int n; #ifdef WIN32 getsockopt(fd, SOL_SOCKET, SO_ERROR, (char *)&n, &intsize); -#elif __APPLE__ +#elif defined(__APPLE__) getsockopt(fd, SOL_SOCKET, SO_ERROR, &n, (int *)&intsize); +#elif defined(__FreeBSD__) + // workaround for FreeBSD. I don't understand this. + struct sockaddr_in sin; + socklen_t sinsz = sizeof(sin); + n = getpeername(fd, (struct sockaddr *)&sin, &sinsz); #else getsockopt(fd, SOL_SOCKET, SO_ERROR, (void*)&n, &intsize); #endif