launch_daemon: don't relaunch when a shutdown is in progress

Change-Id: Ice0dd504f65f592eb64ec0e2192ef42b88486daa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2043
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Jérôme Duval
2019-12-21 20:32:31 +00:00
committed by waddlesplash
parent feeb4b5d93
commit 0749734769
+7 -1
View File
@@ -527,11 +527,17 @@ LaunchDaemon::MessageReceived(BMessage* message)
job->TeamDeleted(); job->TeamDeleted();
if (job->IsService()) { if (job->IsService()) {
bool inProgress = false;
BRoster roster;
BRoster::Private rosterPrivate(roster);
status_t status = rosterPrivate.IsShutDownInProgress(
&inProgress);
if (status != B_OK || !inProgress) {
// TODO: take restart throttle into account // TODO: take restart throttle into account
// TODO: don't restart on shutdown
_LaunchJob(job); _LaunchJob(job);
} }
} }
}
break; break;
} }
case B_SOME_APP_LAUNCHED: case B_SOME_APP_LAUNCHED: