SCR: Tweak mac screensaver for slightly better reliability.

This commit is contained in:
Charlie Fenton 2015-09-29 02:10:07 -07:00
parent fcafba0a87
commit 5f8c9cdeac
1 changed files with 19 additions and 15 deletions

View File

@ -370,22 +370,26 @@ OSStatus CScreensaver::initBOINCApp() {
if (++retryCount > 3) // Limit to 3 relaunches to prevent thrashing
return -1;
#ifdef _DEBUG
err = -1;
#else
err = GetpathToBOINCManagerApp(boincPath, sizeof(boincPath));
#endif
if (err)
{ // If we couldn't find BOINCManager.app, try default path
strcpy(boincPath, "/Applications/");
if (brandId)
strcat(boincPath, m_BrandText);
else
strcat(boincPath, "BOINCManager");
strcat(boincPath, ".app");
// Find boinc client within BOINCManager.app
// First, try default path
strcpy(boincPath, "/Applications/");
if (brandId) {
strcat(boincPath, m_BrandText);
} else {
strcat(boincPath, "BOINCManager");
}
strcat(boincPath, ".app/Contents/Resources/boinc");
// If not at default path, search for it by creator code and bundle identifier
if (!boinc_file_exists(boincPath)) {
err = GetpathToBOINCManagerApp(boincPath, sizeof(boincPath));
if (err) {
saverState = SaverState_CantLaunchCoreClient;
return err;
} else {
strcat(boincPath, "/Contents/Resources/boinc");
}
}
strcat(boincPath, "/Contents/Resources/boinc");
if ( (myPid = fork()) < 0)
return -1;