Commit 04b1b0a6 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

vlc_opendir: simplify and partly revert previous commit

opendir() sets close-on-exec anyway.
parent 09814f3e
......@@ -133,18 +133,7 @@ int vlc_mkdir (const char *dirname, mode_t mode)
*/
DIR *vlc_opendir (const char *dirname)
{
#ifdef O_DIRECTORY
int fd = vlc_open (dirname, O_RDONLY | O_DIRECTORY);
#else /* If O_DIRECTORY is missing. fdopendir() will deal with ENOTDIR. */
int fd = vlc_open (dirname, O_RDONLY);
#endif
if (fd == -1)
return NULL;
DIR *dir = fdopendir (fd);
if (dir == NULL)
close (fd);
return dir;
return opendir (dirname);
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment