about summary refs log tree commit diff
path: root/sysdeps/unix/rewinddir.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/rewinddir.c')
-rw-r--r--sysdeps/unix/rewinddir.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sysdeps/unix/rewinddir.c b/sysdeps/unix/rewinddir.c
index 791ecc1a4b..3a91b06f4a 100644
--- a/sysdeps/unix/rewinddir.c
+++ b/sysdeps/unix/rewinddir.c
@@ -27,7 +27,9 @@ Cambridge, MA 02139, USA.  */
 void
 DEFUN(rewinddir, (dirp), DIR *dirp)
 {
+  __libc_lock_lock (dirp->lock);
   (void) lseek(dirp->fd, (off_t) 0, SEEK_SET);
   dirp->offset = 0;
   dirp->size = 0;
+  __libc_lock_unlock (dirp->lock);
 }