From 5273a32b681a902e00dd44766da0415cfd05a2d1 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Wed, 11 Jan 2012 11:33:03 +0000 Subject: [PATCH] Mgr: When launching Mac client as a daemon, allow time for it to start svn path=/trunk/boinc/; revision=25027 --- checkin_notes | 6 ++++++ clientgui/BOINCClientManager.cpp | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/checkin_notes b/checkin_notes index 1fdf29cff2..70dafd3b25 100644 --- a/checkin_notes +++ b/checkin_notes @@ -360,3 +360,9 @@ David 10 Jan 2012 clientgui/ ViewResources.cpp + +Charlie 11 Jan 2012 + - Mgr: When launching Mac client as a daemon, allow time for it to start. + + clientgui/ + BOINCClientManager.cpp diff --git a/clientgui/BOINCClientManager.cpp b/clientgui/BOINCClientManager.cpp index f6076171b2..9d0de9e817 100644 --- a/clientgui/BOINCClientManager.cpp +++ b/clientgui/BOINCClientManager.cpp @@ -296,7 +296,13 @@ bool CBOINCClientManager::StartupBOINCCore() { if (IsBOINCConfiguredAsDaemon() == NewStyleDaemon) { system ("launchctl load /Library/LaunchDaemons/edu.berkeley.boinc.plist"); system ("launchctl start edu.berkeley.boinc"); - bReturnValue = IsBOINCCoreRunning(); + for (int i=0; i<100; i++) { // Wait up to 1 seccond in 10 ms increments + boinc_sleep(0.01); + if (IsBOINCCoreRunning()) { + bReturnValue = true; + break; + } + } } else { // Get the full path to core client inside this application's bundle