Skip to content

Commit

Permalink
launch_daemon: Fixed resetting launch status, port update.
Browse files Browse the repository at this point in the history
* _SetLaunchStatus() doesn't allow to set the status to B_NO_INIT
  (and rightly so).
* Therefore, we now reset it manually in Job::TeamDeleted(). This
  fixes restarting things that once ran on demand.
* Also update the port message when the default port changes.
  • Loading branch information
axeld committed Nov 11, 2015
1 parent 190df86 commit 93bb55e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/servers/launch/Job.cpp
Expand Up @@ -313,6 +313,16 @@ void
Job::SetDefaultPort(port_id port)
{
fDefaultPort = port;

PortMap::iterator iterator = fPortMap.begin();
for (; iterator != fPortMap.end(); iterator++) {
BString name;
if (iterator->second.HasString("name"))
continue;

iterator->second.SetInt32("port", (int32)port);
break;
}
}


Expand Down Expand Up @@ -396,7 +406,8 @@ Job::TeamDeleted()
if (IsService())
SetState(B_JOB_STATE_WAITING_TO_RUN);

_SetLaunchStatus(B_NO_INIT);
MutexLocker locker(fLaunchStatusLock);
fLaunchStatus = B_NO_INIT;
}


Expand Down

0 comments on commit 93bb55e

Please sign in to comment.