terminal: unexport tcgetpgrp, tcsetpgrp and getpgrp

This commit is contained in:
Michael Eischer
2025-09-08 10:55:58 +02:00
parent e7890d7b81
commit b71b77fa77
8 changed files with 12 additions and 12 deletions

View File

@@ -28,13 +28,13 @@ func startForeground(cmd *exec.Cmd) (bg func() error, err error) {
}
// only move child process to foreground if restic is in the foreground
prev, err := Tcgetpgrp(int(tty.Fd()))
prev, err := tcgetpgrp(int(tty.Fd()))
if err != nil {
_ = tty.Close()
return nil, err
}
self := Getpgrp()
self := getpgrp()
if prev != self {
debug.Log("restic is not controlling the tty; err = %v", err)
if err := tty.Close(); err != nil {
@@ -55,7 +55,7 @@ func startForeground(cmd *exec.Cmd) (bg func() error, err error) {
}
// move the command's process group into the foreground
err = Tcsetpgrp(int(tty.Fd()), cmd.Process.Pid)
err = tcsetpgrp(int(tty.Fd()), cmd.Process.Pid)
if err != nil {
_ = tty.Close()
return nil, err
@@ -66,7 +66,7 @@ func startForeground(cmd *exec.Cmd) (bg func() error, err error) {
signal.Reset(unix.SIGTTOU)
// reset the foreground process group
err = Tcsetpgrp(int(tty.Fd()), prev)
err = tcsetpgrp(int(tty.Fd()), prev)
if err != nil {
_ = tty.Close()
return err