We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 39c2d6a commit a4b8c5bCopy full SHA for a4b8c5b
windows/svc/mgr/service.go
@@ -49,13 +49,16 @@ func (s *Service) Start(args ...string) error {
49
func (s *Service) Control(c svc.Cmd) (svc.Status, error) {
50
var t windows.SERVICE_STATUS
51
err := windows.ControlService(s.Handle, uint32(c), &t)
52
- if err != nil {
+ if err != nil &&
53
+ err != windows.ERROR_INVALID_SERVICE_CONTROL &&
54
+ err != windows.ERROR_SERVICE_CANNOT_ACCEPT_CTRL &&
55
+ err != windows.ERROR_SERVICE_NOT_ACTIVE {
56
return svc.Status{}, err
57
}
58
return svc.Status{
59
State: svc.State(t.CurrentState),
60
Accepts: svc.Accepted(t.ControlsAccepted),
- }, nil
61
+ }, err
62
63
64
// Query returns current status of service s.
0 commit comments