mirror of
https://github.com/go-gitea/gitea
synced 2025-07-13 14:07:20 +00:00
go1.16 (#14783)
This commit is contained in:
7
vendor/golang.org/x/sys/windows/svc/security.go
generated
vendored
7
vendor/golang.org/x/sys/windows/svc/security.go
generated
vendored
@ -96,6 +96,13 @@ func IsWindowsService() (bool, error) {
|
||||
var psid uint32
|
||||
err := windows.ProcessIdToSessionId(uint32(pbi[5]), &psid)
|
||||
if err != nil {
|
||||
if err == windows.ERROR_INVALID_PARAMETER {
|
||||
// This error happens when Windows cannot find process parent.
|
||||
// Perhaps process parent exited.
|
||||
// Assume we are not running in a service, because service
|
||||
// parent process (services.exe) cannot exit.
|
||||
return false, nil
|
||||
}
|
||||
return false, err
|
||||
}
|
||||
if psid != 0 {
|
||||
|
Reference in New Issue
Block a user