MCPcopy Index your code
hub / github.com/coder/coder / Close

Method Close

pty/pty_other.go:128–153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

126}
127
128func (p *otherPty) Close() error {
129 p.mutex.Lock()
130 defer p.mutex.Unlock()
131
132 if p.closed {
133 return p.err
134 }
135 p.closed = true
136
137 err := p.pty.Close()
138 // tty is closed & unset if we Start() a new process
139 if p.tty != nil {
140 err2 := p.tty.Close()
141 if err == nil {
142 err = err2
143 }
144 }
145
146 if err != nil {
147 p.err = err
148 } else {
149 p.err = ErrClosed
150 }
151
152 return err
153}
154
155type otherProcess struct {
156 pty *os.File

Callers 1

newPtyFunction · 0.95

Calls 3

CloseMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected