Files
coder/agent/agentscripts/agentscripts_windows.go
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
420 B
Go
Raw Normal View History

2023-09-25 16:47:17 -05:00
package agentscripts
import (
"context"
2023-09-25 16:47:17 -05:00
"os"
"os/exec"
"syscall"
"cdr.dev/slog"
2023-09-25 16:47:17 -05:00
)
func cmdSysProcAttr() *syscall.SysProcAttr {
return &syscall.SysProcAttr{}
}
func cmdCancel(ctx context.Context, logger slog.Logger, cmd *exec.Cmd) func() error {
2023-09-25 16:47:17 -05:00
return func() error {
logger.Debug(ctx, "cmdCancel: sending interrupt to process", slog.F("pid", cmd.Process.Pid))
2023-09-25 16:47:17 -05:00
return cmd.Process.Signal(os.Interrupt)
}
}