mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Implement code review remarks
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user