summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);