Skip to content

Commit 9b5bf7c

Browse files
committed
intra: m close dup'd crash fd writer
1 parent 5a2d5dd commit 9b5bf7c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

intra/tun2socks.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,11 @@ func pipeCrashOutput(bdg Bridge) (ok bool) {
265265
log.E("tun: err crash output pipe: %v", err)
266266
return false
267267
}
268+
// core.Close(r) // do not close as r isn't dup'd by client code
269+
defer core.Close(w) // always close as w is dup'd by the runtime
268270
if setCrashFd(w) && bdg.CrashFD(int(r.Fd())) {
269271
return true
270272
}
271-
core.Close(r)
272-
core.Close(w)
273273
return false
274274
}
275275

0 commit comments

Comments
 (0)