From 6fb2dde3f1aa3a1419cb6c2dfa53dd1d506722a4 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 8 May 2011 14:53:20 -0400 Subject: Make complete getcwd work in rtld --- sysdeps/unix/rewinddir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sysdeps/unix/rewinddir.c') diff --git a/sysdeps/unix/rewinddir.c b/sysdeps/unix/rewinddir.c index 89b0e6d..9672893 100644 --- a/sysdeps/unix/rewinddir.c +++ b/sysdeps/unix/rewinddir.c @@ -23,16 +23,19 @@ #include /* Rewind DIRP to the beginning of the directory. */ -/* XXX should be __rewinddir ? */ void rewinddir (dirp) DIR *dirp; { +#ifndef NOT_IN_libc __libc_lock_lock (dirp->lock); +#endif (void) __lseek (dirp->fd, (off_t) 0, SEEK_SET); dirp->filepos = 0; dirp->offset = 0; dirp->size = 0; +#ifndef NOT_IN_libc __libc_lock_unlock (dirp->lock); +#endif } libc_hidden_def (rewinddir) -- cgit v1.1