summaryrefslogtreecommitdiff
path: root/lib/libc/gen/rewinddir.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2013-11-05 20:36:52 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2013-11-05 20:36:52 +0000
commit5fd73121dd5f0d0304bb27597049614c51835609 (patch)
tree49b89b7ccb2a1c35d20003fb6c3e0cd48d2eb318 /lib/libc/gen/rewinddir.c
parent4ca0f23bbab883d9309f33e64c977e6d5c5e9261 (diff)
Cleanup, no functional change:
1. avoid code duplication in rewinddir() by calling seekdir() directly 2. move __seekdir() into seekdir() and _telldir_unlocked() into telldir() Both functions were called from nowhere else. 3. remove some unused #include directives and one unused function prototype ok otto@ millert@
Diffstat (limited to 'lib/libc/gen/rewinddir.c')
-rw-r--r--lib/libc/gen/rewinddir.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/libc/gen/rewinddir.c b/lib/libc/gen/rewinddir.c
index 3844b63efdb..49e7a435cee 100644
--- a/lib/libc/gen/rewinddir.c
+++ b/lib/libc/gen/rewinddir.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: rewinddir.c,v 1.10 2013/08/13 05:52:12 guenther Exp $ */
-/*-
+/* $OpenBSD: rewinddir.c,v 1.11 2013/11/05 20:36:51 schwarze Exp $ */
+/*
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -28,16 +28,12 @@
* SUCH DAMAGE.
*/
-#include <sys/types.h>
#include <dirent.h>
-
#include "thread_private.h"
#include "telldir.h"
void
rewinddir(DIR *dirp)
{
- _MUTEX_LOCK(&dirp->dd_lock);
- __seekdir(dirp, 0);
- _MUTEX_UNLOCK(&dirp->dd_lock);
+ seekdir(dirp, 0);
}