libroot_build: fs_darwin: fdopendir(): close FD on success

fdopendir() is supposed to consume the specified FD on success.
This commit is contained in:
Ingo Weinhold 2013-09-29 22:37:07 +02:00 committed by Niels Sascha Reedijk
parent f04f7042c5
commit 5fd3766e03

View File

@ -230,7 +230,11 @@ fdopendir(int fd)
return NULL;
}
return opendir(path);
DIR* dir = opendir(path);
if (dir != NULL)
close(fd);
return dir;
}