diff options
author | Daniel Baumann <daniel@debian.org> | 2024-10-20 23:07:42 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2024-11-09 15:38:42 +0100 |
commit | 714c83b2736d7e308bc33c49057952490eb98be2 (patch) | |
tree | 1d9ba7035798368569cd49056f4d596efc908cd8 /pkg/container/util.go | |
parent | Initial commit. (diff) | |
download | forgejo-act-714c83b2736d7e308bc33c49057952490eb98be2.tar.xz forgejo-act-714c83b2736d7e308bc33c49057952490eb98be2.zip |
Adding upstream version 1.21.4.
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to 'pkg/container/util.go')
-rw-r--r-- | pkg/container/util.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/pkg/container/util.go b/pkg/container/util.go new file mode 100644 index 0000000..96143a5 --- /dev/null +++ b/pkg/container/util.go @@ -0,0 +1,26 @@ +//go:build (!windows && !plan9 && !openbsd) || (!windows && !plan9 && !mips64) + +package container + +import ( + "os" + "syscall" + + "github.com/creack/pty" +) + +func getSysProcAttr(_ string, tty bool) *syscall.SysProcAttr { + if tty { + return &syscall.SysProcAttr{ + Setsid: true, + Setctty: true, + } + } + return &syscall.SysProcAttr{ + Setpgid: true, + } +} + +func openPty() (*os.File, *os.File, error) { + return pty.Open() +} |