repo.or.cz
/
minix.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
isblank() implementation.
[minix.git]
/
lib
/
libc
/
posix
/
_closedir.c
blob
50fcec2812ff90e3b06c75ef7db5aecacd1c5481
1
/* closedir() Author: Kees J. Bot
2
* 24 Apr 1989
3
*/
4
#define nil 0
5
#include <lib.h>
6
#define close _close
7
#define closedir _closedir
8
#include <sys/types.h>
9
#include <dirent.h>
10
#include <unistd.h>
11
#include <stdlib.h>
12
#include <errno.h>
13
14
int
closedir
(
DIR
*
dp
)
15
/* Finish reading a directory. */
16
{
17
int
d
;
18
19
if
(
dp
==
nil
) {
errno
=
EBADF
;
return
-
1
; }
20
21
d
=
dp
->
_fd
;
22
free
((
void
*)
dp
);
23
return
close
(
d
);
24
}