From 7745119dc6dbe213caa75b69ffb8844e632a5172 Mon Sep 17 00:00:00 2001
From: Ingo Weinhold <ingo_weinhold@gmx.de>
Date: Sun, 29 Sep 2013 22:37:07 +0200
Subject: [PATCH] libroot_build: fs_darwin: fdopendir(): close FD on success
fdopendir() is supposed to consume the specified FD on success.
---
src/build/libroot/fs_darwin.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/build/libroot/fs_darwin.cpp b/src/build/libroot/fs_darwin.cpp
index f381bd0..f4d11b6 100644
a
|
b
|
fdopendir(int fd)
|
230 | 230 | return NULL; |
231 | 231 | } |
232 | 232 | |
233 | | return opendir(path); |
| 233 | DIR* dir = opendir(path); |
| 234 | if (dir != NULL) |
| 235 | close(fd); |
| 236 | |
| 237 | return dir; |
234 | 238 | } |
235 | 239 | |
236 | 240 | |