mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-30 21:27:05 +00:00
eea03676d3
Signed-off-by: Royce Remer <royceremer@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
20 lines
402 B
Go
20 lines
402 B
Go
// Copyright 2026 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package process
|
|
|
|
import "os/exec"
|
|
|
|
// There is no graceful way to kill a process on Windows at the moment
|
|
|
|
func setSysProcAttribute(cmd *exec.Cmd) {}
|
|
|
|
func (c *Cmd) onCancel() error {
|
|
if c.onCancelUserFunc != nil {
|
|
if err := c.onCancelUserFunc(); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return c.Process.Kill()
|
|
}
|