We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9d97d95 commit 2f53768Copy full SHA for 2f53768
tun_darwin.go
@@ -158,7 +158,10 @@ func (t *NativeTun) Close() error {
158
return t.tunFile.Close()
159
}
160
defer flushDNSCache()
161
- return E.Errors(t.unsetRoutes(), t.tunFile.Close())
+ t.stopFd.Stop()
162
+ err := E.Errors(t.unsetRoutes(), t.tunFile.Close())
163
+ t.stopFd.Close()
164
+ return err
165
166
167
func (t *NativeTun) Read(p []byte) (n int, err error) {
@@ -356,6 +359,9 @@ func (t *NativeTun) BatchRead() ([]*buf.Buffer, error) {
356
359
t.buffers = t.buffers[:0]
357
360
return nil, errno
358
361
362
+ if n < 0 {
363
+ return nil, os.ErrClosed
364
+ }
365
if n < 1 {
366
return nil, nil
367
0 commit comments