From: Cherry Zhang Date: Wed, 27 May 2020 00:02:43 +0000 (-0400) Subject: cmd/link: actually close the output file X-Git-Tag: go1.15beta1~103 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=902d8de79ed9bb6013cdb1952db1538bc1d10677;p=gostls13.git cmd/link: actually close the output file When the output file is mmap'd, OutBuf.Close currently munmap the file but doesn't actually close the file descriptor. This CL makes it actually close the FD. Change-Id: I053c5592ae95497228c50ce6a267b3b48f0af6d6 Reviewed-on: https://go-review.googlesource.com/c/go/+/235417 Run-TryBot: Cherry Zhang Reviewed-by: Than McIntosh --- diff --git a/src/cmd/link/internal/ld/outbuf.go b/src/cmd/link/internal/ld/outbuf.go index 4ce211172c..09162ae90f 100644 --- a/src/cmd/link/internal/ld/outbuf.go +++ b/src/cmd/link/internal/ld/outbuf.go @@ -115,7 +115,6 @@ func (out *OutBuf) Close() error { if out.isMmapped() { out.copyHeap() out.munmap() - return nil } if out.f == nil { return nil