about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-02-19 05:44:33 +0000
committerUlrich Drepper <drepper@redhat.com>2007-02-19 05:44:33 +0000
commit858ee15decf0c6d6ff74ae5c1baae1652b3b5e84 (patch)
tree5a69e68d8bed42611c141da225b21fc74863a175 /sysdeps
parentecb72bd5b640497474ceae8d5e991b88c0c032e2 (diff)
downloadglibc-858ee15decf0c6d6ff74ae5c1baae1652b3b5e84.tar.gz
glibc-858ee15decf0c6d6ff74ae5c1baae1652b3b5e84.tar.xz
glibc-858ee15decf0c6d6ff74ae5c1baae1652b3b5e84.zip
* sysdeps/unix/closedir.c: Outside libc don't use locking.
	* sysdeps/unix/opendir.c: Likewise.
	* sysdeps/unix/readdir.c: Likewise.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/closedir.c4
-rw-r--r--sysdeps/unix/opendir.c5
-rw-r--r--sysdeps/unix/readdir.c7
3 files changed, 12 insertions, 4 deletions
diff --git a/sysdeps/unix/closedir.c b/sysdeps/unix/closedir.c
index 09deee7e85..3d65e14f61 100644
--- a/sysdeps/unix/closedir.c
+++ b/sysdeps/unix/closedir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1993,1995,1996,1998,2002,2003
+/* Copyright (C) 1991,1993,1995,1996,1998,2002,2003, 2007
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -45,7 +45,9 @@ __closedir (DIR *dirp)
 
   fd = dirp->fd;
 
+#ifndef NOT_IN_libc
   __libc_lock_fini (dirp->lock);
+#endif
 
   free ((void *) dirp);
 
diff --git a/sysdeps/unix/opendir.c b/sysdeps/unix/opendir.c
index 6aa738fb69..59772cda75 100644
--- a/sysdeps/unix/opendir.c
+++ b/sysdeps/unix/opendir.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991-1996,98,2000-2003,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1996,98,2000-2003,2005,2007
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -173,7 +174,9 @@ __alloc_dir (int fd, bool close_fd, const struct stat64 *statp)
   dirp->allocation = allocation;
   dirp->fd = fd;
 
+#ifndef NOT_IN_libc
   __libc_lock_init (dirp->lock);
+#endif
 
   return dirp;
 }
diff --git a/sysdeps/unix/readdir.c b/sysdeps/unix/readdir.c
index 4a0f0890e9..13e5e9a021 100644
--- a/sysdeps/unix/readdir.c
+++ b/sysdeps/unix/readdir.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991,92,93,94,95,96,97,99,2000,02
-	Free Software Foundation, Inc.
+/* Copyright (C) 1991-1997,1999,2000,2002,2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -42,7 +41,9 @@ __READDIR (DIR *dirp)
   DIRENT_TYPE *dp;
   int saved_errno = errno;
 
+#ifndef NOT_IN_libc
   __libc_lock_lock (dirp->lock);
+#endif
 
   do
     {
@@ -110,7 +111,9 @@ __READDIR (DIR *dirp)
       /* Skip deleted files.  */
     } while (dp->d_ino == 0);
 
+#ifndef NOT_IN_libc
   __libc_lock_unlock (dirp->lock);
+#endif
 
   return dp;
 }