diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2021-01-29 14:24:29 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2021-01-29 14:24:29 -0500 |
commit | 03875eb1aea9abc8a1ef0b081c33e48e582ae462 (patch) | |
tree | a8d4fea2cb2d12e9a77e55e26d14e7b2b02566e1 | |
parent | 6251c29f126b30f798a9bf909f9f66a84a20c334 (diff) | |
download | bfs-03875eb1aea9abc8a1ef0b081c33e48e582ae462.tar.xz |
dir: Use fdclosedir() for bfs_freedir() on FreeBSD
-rw-r--r-- | dir.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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); |