lib/syncthing: Modify exit status before stopping (fixes #5869) (#5870)

This commit is contained in:
Simon Frei 2019-07-18 20:49:00 +02:00 committed by Jakob Borg
parent e7e177a6fa
commit 1894123d3c
1 changed files with 6 additions and 6 deletions

View File

@ -407,13 +407,13 @@ func (a *App) Stop(stopReason ExitStatus) ExitStatus {
case <-a.stopped:
case <-a.stop:
default:
// ExitSuccess is the default value for a.exitStatus. If another status
// was already set, ignore the stop reason given as argument to Stop.
if a.exitStatus == ExitSuccess {
a.exitStatus = stopReason
}
close(a.stop)
}
<-a.stopped
// ExitSuccess is the default value for a.exitStatus. If another status
// was already set, ignore the stop reason given as argument to Stop.
if a.exitStatus == ExitSuccess {
a.exitStatus = stopReason
<-a.stopped
}
return a.exitStatus
}