From a4f07581502ee212aa45e7b0049fdd126dd10b40 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Sat, 11 May 2002 00:26:15 +0000 Subject: Implement readdir_r. Audit for proper thread safety and locking. -Erik --- libc/misc/dirent/opendir.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libc/misc/dirent/opendir.c') diff --git a/libc/misc/dirent/opendir.c b/libc/misc/dirent/opendir.c index e2a6000ca..48911ce32 100644 --- a/libc/misc/dirent/opendir.c +++ b/libc/misc/dirent/opendir.c @@ -39,7 +39,6 @@ DIR *opendir(const char *name) ptr->dd_fd = fd; ptr->dd_nextloc = ptr->dd_size = ptr->dd_nextoff = 0; - ptr->dd_getdents = unknown; ptr->dd_max = statbuf.st_blksize; if (ptr->dd_max < 512) @@ -52,5 +51,8 @@ DIR *opendir(const char *name) return NULL; } ptr->dd_buf = buf; +#ifdef _POSIX_THREADS + pthread_mutex_init(ptr->dd_lock, NULL); +#endif return ptr; } -- cgit v1.2.3