From c1c2a539afea30fcfdd8982c33c72e4f5dce2cbf Mon Sep 17 00:00:00 2001 From: lifubang Date: Tue, 18 Nov 2025 09:57:17 +0000 Subject: [PATCH] gopathrs: close the fd after dup in openat2 Signed-off-by: lifubang --- pathrs-lite/internal/gopathrs/openat2_linux.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pathrs-lite/internal/gopathrs/openat2_linux.go b/pathrs-lite/internal/gopathrs/openat2_linux.go index b80ecd0..9c5c268 100644 --- a/pathrs-lite/internal/gopathrs/openat2_linux.go +++ b/pathrs-lite/internal/gopathrs/openat2_linux.go @@ -41,6 +41,7 @@ func openat2(dir fd.Fd, path string, how *unix.OpenHow) (*os.File, error) { if err != nil { return nil, err } + _ = file.Close() file = newFile } }