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 <waddlesplash@gmail.com>
This commit is contained in:
Jérôme Duval 2019-12-21 17:29:11 +01:00 committed by waddlesplash
parent feeb4b5d93
commit 0749734769

View File

@ -527,9 +527,15 @@ LaunchDaemon::MessageReceived(BMessage* message)
job->TeamDeleted();
if (job->IsService()) {
// TODO: take restart throttle into account
// TODO: don't restart on shutdown
_LaunchJob(job);
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
_LaunchJob(job);
}
}
}
break;