repo.or.cz
/
glibc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Don't crash when dependencies are missing
[glibc.git]
/
manual
/
examples
/
dir.c
blob
8ab77dc34c3c2e9b77bd3b25a61e03d52419a546
1
/*@group*/
2
#include <stdio.h>
3
#include <sys/types.h>
4
#include <dirent.h>
5
/*@end group*/
6
7
int
8
main
(
void
)
9
{
10
DIR
*
dp
;
11
struct
dirent
*
ep
;
12
13
dp
=
opendir
(
"./"
);
14
if
(
dp
!=
NULL
)
15
{
16
while
(
ep
=
readdir
(
dp
))
17
puts
(
ep
->
d_name
);
18
(
void
)
closedir
(
dp
);
19
}
20
else
21
perror
(
"Couldn't open the directory"
);
22
23
return
0
;
24
}