From 71b20283a6d41a08855cfb34b373e49091b6959a Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 4 Feb 2006 02:20:46 +0000 Subject: add note about racecondition --- libc/misc/dirent/opendir.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libc/misc') 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" . */ -- cgit v1.2.3