summaryrefslogtreecommitdiff
path: root/libc/misc
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-02-04 02:20:46 +0000
committerMike Frysinger <vapier@gentoo.org>2006-02-04 02:20:46 +0000
commit71b20283a6d41a08855cfb34b373e49091b6959a (patch)
treefe3516ec4139eb009d478b8282585931fabdfc1d /libc/misc
parentf4bfb87ce5efc8d6e0794fffa453df6c55e0b7e7 (diff)
add note about racecondition
Diffstat (limited to 'libc/misc')
-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>.
*/