mirror of https://github.com/BOINC/boinc.git
client: Avoid kernel panics at system boot when running as a service / daemon under Mac OS 10.10.4.
This commit is contained in:
parent
2ce9113db4
commit
272c2b0c68
client
|
@ -1,6 +1,6 @@
|
|||
// This file is part of BOINC.
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2008 University of California
|
||||
// Copyright (C) 2015 University of California
|
||||
//
|
||||
// BOINC is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License
|
||||
|
@ -47,9 +47,12 @@
|
|||
|
||||
#endif
|
||||
|
||||
#if (defined (__APPLE__) && defined(SANDBOX) && defined(_DEBUG))
|
||||
#ifdef __APPLE__
|
||||
#include <Carbon/Carbon.h>
|
||||
#if (defined(SANDBOX) && defined(_DEBUG))
|
||||
#include "SetupSecurity.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "diagnostics.h"
|
||||
#include "error_numbers.h"
|
||||
|
@ -352,6 +355,15 @@ int boinc_main_loop() {
|
|||
retval = initialize();
|
||||
if (retval) return retval;
|
||||
|
||||
#ifdef __APPLE__
|
||||
// If we run too soon during system boot we can cause a kernel panic
|
||||
if (gstate.executing_as_daemon) {
|
||||
if (TickCount() < (120*60)) { // If system has been up for less than 2 minutes
|
||||
boinc_sleep(30.);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
retval = gstate.init();
|
||||
if (retval) {
|
||||
log_message_error("gstate.init() failed", retval);
|
||||
|
|
Loading…
Reference in New Issue