diff options
Diffstat (limited to 'newlib/libc/posix/opendir.c')
-rw-r--r-- | newlib/libc/posix/opendir.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/newlib/libc/posix/opendir.c b/newlib/libc/posix/opendir.c index f924c0b52..de14edcad 100644 --- a/newlib/libc/posix/opendir.c +++ b/newlib/libc/posix/opendir.c @@ -41,6 +41,7 @@ static char sccsid[] = "@(#)opendir.c 5.11 (Berkeley) 2/23/91"; #include <fcntl.h> #include <stdlib.h> #include <unistd.h> +#include <sys/lock.h> /* * open a directory. @@ -78,6 +79,12 @@ opendir(name) /* * Set up seek point for rewinddir. */ + +#ifdef HAVE_DD_LOCK + /* if we have a locking mechanism, initialize it */ + __lock_init_recursive(dirp->dd_lock); +#endif + return dirp; } |