aboutsummaryrefslogtreecommitdiffstats
path: root/tests/readdir_inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/readdir_inode.c')
-rw-r--r--tests/readdir_inode.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/readdir_inode.c b/tests/readdir_inode.c
index ed413be..532d2e2 100644
--- a/tests/readdir_inode.c
+++ b/tests/readdir_inode.c
@@ -20,15 +20,16 @@ int main(int argc, char* argv[])
return 2;
}
+ errno = 0;
dent = readdir(dirp);
while (dent != NULL) {
- if (errno != 0) {
- perror("failed to read directory entry");
- return 3;
- }
printf("%llu %s\n", (unsigned long long)dent->d_ino, dent->d_name);
dent = readdir(dirp);
}
+ if (errno != 0) {
+ perror("failed to read directory entry");
+ return 3;
+ }
closedir(dirp);