aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-01-04 22:03:24 +0800
committerRunxi Yu <me@runxiyu.org>2025-01-04 22:03:24 +0800
commitf57ba68adb4d9a3781320da9343e5e021c5a8e9e (patch)
treefed18a68eddfb01557cf7206c2cd3374b4b79ec1
parentmisc: O_CLOEXEC to all open-related syscalls (diff)
downloadgo-lindenii-common-f57ba68adb4d9a3781320da9343e5e021c5a8e9e.tar.gz
go-lindenii-common-f57ba68adb4d9a3781320da9343e5e021c5a8e9e.tar.zst
go-lindenii-common-f57ba68adb4d9a3781320da9343e5e021c5a8e9e.zip
misc: Make Dir_t.Close() a method
-rw-r--r--misc/open_file.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/misc/open_file.go b/misc/open_file.go
index 5bc6067..ec5d402 100644
--- a/misc/open_file.go
+++ b/misc/open_file.go
@@ -52,7 +52,7 @@ func Open_directory_readonly(path string) (Dir_t, error) {
}
// Close a directory returned by [Open_directory_readonly].
-func Close_directory(dir Dir_t) error {
+func (dir *Dir_t) Close() error {
return syscall.Close(dir.fd)
}