Implement code review remarks

This commit is contained in:
Wim
2023-02-23 13:16:56 +01:00
parent 1dc92a8c71
commit a88680b765
2 changed files with 6 additions and 8 deletions
+1 -5
View File
@@ -112,7 +112,7 @@ type lineDiscipline struct {
// replicaWaiter is used to wait on the replica end of the TTY.
replicaWaiter waiter.Queue
// terminal is the terminal linked to this lineDiscipline
// terminal is the terminal linked to this lineDiscipline.
terminal *Terminal
}
@@ -123,10 +123,6 @@ func newLineDiscipline(termios linux.KernelTermios) *lineDiscipline {
return &ld
}
func (l *lineDiscipline) SetTerminal(tm *Terminal) {
l.terminal = tm
}
// getTermios gets the linux.Termios for the tty.
func (l *lineDiscipline) getTermios(task *kernel.Task, args arch.SyscallArguments) (uintptr, error) {
l.termiosMu.RLock()
+5 -3
View File
@@ -54,7 +54,8 @@ func newTerminal(n uint32) *Terminal {
replicaKTTY: &kernel.TTY{Index: n},
}
t.ld.SetTerminal(&t)
t.ld.terminal = &t
return &t
}
@@ -111,9 +112,10 @@ func (tm *Terminal) setForegroundProcessGroup(ctx context.Context, args arch.Sys
return 0, err
}
tm.fgProcessGroup = task.ThreadGroup().ProcessGroup()
ret, err := task.ThreadGroup().SetForegroundProcessGroup(tm.tty(isMaster), kernel.ProcessGroupID(pgid))
if err == nil {
tm.fgProcessGroup = task.PIDNamespace().ProcessGroupWithID(kernel.ProcessGroupID(pgid))
}
return uintptr(ret), err
}