Skip to content

Commit 3515ae9

Browse files
committed
configure accepts on status
1 parent 9e18c22 commit 3515ae9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

notify/notify_windows.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ func Status(name string) error {
7171
}
7272

7373
var state svc.State
74+
var accepts svc.Accepted
75+
accepts = 0
7476

7577
switch strings.ToLower(name) {
7678
case "stopped":
@@ -81,17 +83,19 @@ func Status(name string) error {
8183
state = svc.StopPending
8284
case "running":
8385
state = svc.Running
86+
accepts = svc.AcceptStop | svc.AcceptShutdown
8487
case "continue_pending":
8588
state = svc.ContinuePending
8689
case "pause_pending":
8790
state = svc.PausePending
8891
case "paused":
8992
state = svc.Paused
93+
accepts = svc.AcceptStop | svc.AcceptShutdown | svc.AcceptPauseAndContinue
9094
default:
9195
return fmt.Errorf("unknown status: %s", name)
9296
}
9397

94-
globalStatus <- svc.Status{State: state}
98+
globalStatus <- svc.Status{State: state, Accepts: accepts}
9599
return nil
96100
}
97101

0 commit comments

Comments
 (0)