summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
Diffstat (limited to 'libc')
-rw-r--r--libc/misc/dirent/opendir.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libc/misc/dirent/opendir.c b/libc/misc/dirent/opendir.c
index 5c78252b1..318f4bef2 100644
--- a/libc/misc/dirent/opendir.c
+++ b/libc/misc/dirent/opendir.c
@@ -42,6 +42,11 @@ DIR *opendir(const char *name)
#endif
if ((fd = open(name, O_RDONLY|O_NDELAY|O_DIRECTORY)) < 0)
return NULL;
+ /* Note: we should check to make sure that between the stat() and open()
+ * call, 'name' didnt change on us, but that's only if O_DIRECTORY isnt
+ * defined and since Linux has supported it for like ever, i'm not going
+ * to worry about it right now (if ever). */
+
/* According to POSIX, directory streams should be closed when
* exec. From "Anna Pluzhnikov" <besp@midway.uchicago.edu>.
*/