summaryrefslogtreecommitdiff
path: root/debian/readdir-hppa-test.c
diff options
context:
space:
mode:
authorSune Vuorela <debian@pusling.com>2007-08-09 10:19:33 +0000
committerSune Vuorela <debian@pusling.com>2007-08-09 10:19:33 +0000
commit3436d24fb4c71be71e1e3eeafe20ee931ea44aa6 (patch)
treeba7cb8aa666bd4ad5ddf1a99d5c7da4c2aa27203 /debian/readdir-hppa-test.c
parentff07f00bf37b16a834d5e5dec1d052a3e622a306 (diff)
downloadqt4-x11-3436d24fb4c71be71e1e3eeafe20ee931ea44aa6.tar.gz
add a test for broken hppa getdents
Diffstat (limited to 'debian/readdir-hppa-test.c')
-rw-r--r--debian/readdir-hppa-test.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/debian/readdir-hppa-test.c b/debian/readdir-hppa-test.c
new file mode 100644
index 0000000..eb893ba
--- /dev/null
+++ b/debian/readdir-hppa-test.c
@@ -0,0 +1,25 @@
+#include <sys/types.h>
+#include <dirent.h>
+#include <errno.h>
+#include <stdio.h>
+
+main() {
+ int return_code;
+ DIR *dir;
+ struct dirent entry;
+ struct dirent *result;
+
+ if ((dir = opendir(".")) == NULL)
+ perror("opendir() error");
+ else {
+ // puts("contents of .:");
+ for (return_code = readdir_r(dir, &entry, &result);
+ result != NULL && return_code == 0;
+ return_code = readdir_r(dir, &entry, &result))
+ printf("%s\n", entry.d_name);
+ if (return_code != 0)
+ perror("readdir_r() error");
+ closedir(dir);
+ }
+}
+