Allow `<stopexecutable>` without arguments

pull/440/head
NextTurn 2020-08-02 00:00:00 +08:00 committed by Next Turn
parent 9573a78668
commit 35ebd4a0a1
1 changed files with 4 additions and 3 deletions

View File

@ -361,11 +361,12 @@ namespace WinSW
} }
} }
string? stopArguments = this.config.StopArguments;
this.LogInfo("Stopping " + this.config.Id); this.LogInfo("Stopping " + this.config.Id);
this.orderlyShutdown = true; this.orderlyShutdown = true;
if (stopArguments is null) string? stopExecutable = this.config.StopExecutable;
string? stopArguments = this.config.StopArguments;
if (stopExecutable is null && stopArguments is null)
{ {
Log.Debug("ProcessKill " + this.process.Id); Log.Debug("ProcessKill " + this.process.Id);
this.process.StopTree(this.config.StopTimeout); this.process.StopTree(this.config.StopTimeout);
@ -375,7 +376,7 @@ namespace WinSW
{ {
this.SignalPending(); this.SignalPending();
string stopExecutable = this.config.StopExecutable ?? this.config.Executable; stopExecutable ??= this.config.Executable;
try try
{ {