mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-10 15:20:56 +00:00
This commit is contained in:
parent
e7e177a6fa
commit
1894123d3c
@ -407,14 +407,14 @@ func (a *App) Stop(stopReason ExitStatus) ExitStatus {
|
|||||||
case <-a.stopped:
|
case <-a.stopped:
|
||||||
case <-a.stop:
|
case <-a.stop:
|
||||||
default:
|
default:
|
||||||
close(a.stop)
|
|
||||||
}
|
|
||||||
<-a.stopped
|
|
||||||
// ExitSuccess is the default value for a.exitStatus. If another status
|
// ExitSuccess is the default value for a.exitStatus. If another status
|
||||||
// was already set, ignore the stop reason given as argument to Stop.
|
// was already set, ignore the stop reason given as argument to Stop.
|
||||||
if a.exitStatus == ExitSuccess {
|
if a.exitStatus == ExitSuccess {
|
||||||
a.exitStatus = stopReason
|
a.exitStatus = stopReason
|
||||||
}
|
}
|
||||||
|
close(a.stop)
|
||||||
|
<-a.stopped
|
||||||
|
}
|
||||||
return a.exitStatus
|
return a.exitStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user