turbo-editors/turbo-corepublic Fork 0
28d59854361aeda8541d853093e732126f3d7bff
Commits
Clone
git clone https://git.rickub.com/turbo-editors/turbo-core.git
git clone ssh://git@rickub.com/turbo-editors/turbo-core.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

group_other.go · 34 lines · 1.1 KBGo Blame HistoryRaw
🛟 Updated. 28d5985 k33g 14h ago1//go:build !unix && !windows
2
3package tools
4
5import (
6 "os"
7 "os/exec"
8 "syscall"
9)
10
11// shellProgram is a guess on a platform this package does not know.
12func shellProgram() string { return "/bin/sh" }
13
14// shellArgs assumes a Bourne-style shell.
15func shellArgs(command string) []string { return []string{"-c", command} }
16
17// childAttributes asks for nothing on a platform without process groups.
18func childAttributes(*exec.Cmd, string) *syscall.SysProcAttr { return nil }
19
20// loneProcess is a command with nothing grouping what it started.
21type loneProcess struct{ process *os.Process }
22
23// newGroup has no group to offer.
24func newGroup(process *os.Process) group { return loneProcess{process: process} }
25
26// kill stops the process alone.
27//
28// Anything it started keeps running, and if that child holds the output pipe
29// the run will not report itself finished until WaitDelay expires. That is the
30// backstop rather than the intent; a platform-specific way to end a whole
31// process tree would be the real answer here.
32func (g loneProcess) kill() { _ = g.process.Kill() }
33
34func (loneProcess) release() {}