2 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
4 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
11 #include "dirstream.h"
12 #include <not-cancel.h>
15 int closedir(DIR * dir)
24 /* We need to check dd_fd. */
25 if (dir->dd_fd == -1) {
29 __UCLIBC_MUTEX_LOCK(dir->dd_lock);
32 __UCLIBC_MUTEX_UNLOCK(dir->dd_lock);
35 return close_not_cancel(fd);
37 libc_hidden_def(closedir)