summaryrefslogtreecommitdiff
path: root/dirent
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1993-05-13 03:39:44 +0000
committerRoland McGrath <roland@gnu.org>1993-05-13 03:39:44 +0000
commit0ef8810bf6a5cc76872e0ead04a0dc4ac5d97195 (patch)
tree80174d0e78a1a412b8f176d8ddb068327556c235 /dirent
parent6222ab3eccb40f5e96fdaa4fcd2d251f2d891664 (diff)
entered into RCS
Diffstat (limited to 'dirent')
-rw-r--r--dirent/list.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/dirent/list.c b/dirent/list.c
index 2cfae4138f..606bd42591 100644
--- a/dirent/list.c
+++ b/dirent/list.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1993 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -39,10 +39,14 @@ DEFUN(test, (name), CONST char *name)
return;
}
+ errno = 0;
while ((entp = readdir(dirp)) != NULL)
printf("%s\tfile number %lu\n",
entp->d_name, (unsigned long int) entp->d_fileno);
+ if (errno)
+ perror ("readdir");
+
if (closedir(dirp) < 0)
perror("closedir");
}