summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2021-01-29 14:24:29 -0500
committerTavian Barnes <tavianator@tavianator.com>2021-01-29 14:24:29 -0500
commit03875eb1aea9abc8a1ef0b081c33e48e582ae462 (patch)
treea8d4fea2cb2d12e9a77e55e26d14e7b2b02566e1
parent6251c29f126b30f798a9bf909f9f66a84a20c334 (diff)
downloadbfs-03875eb1aea9abc8a1ef0b081c33e48e582ae462.tar.xz
dir: Use fdclosedir() for bfs_freedir() on FreeBSD
-rw-r--r--dir.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/dir.c b/dir.c
index d206c71..2c76b54 100644
--- a/dir.c
+++ b/dir.c
@@ -291,6 +291,10 @@ int bfs_freedir(struct bfs_dir *dir) {
int ret = dir->fd;
free(dir);
return ret;
+#elif __FreeBSD__
+ int ret = fdclosedir(dir->dir);
+ free(dir);
+ return ret;
#else
int ret = dup_cloexec(dirfd(dir->dir));
bfs_closedir(dir);