diff options
author | Sune Vuorela <debian@pusling.com> | 2007-08-09 10:19:33 +0000 |
---|---|---|
committer | Sune Vuorela <debian@pusling.com> | 2007-08-09 10:19:33 +0000 |
commit | 3436d24fb4c71be71e1e3eeafe20ee931ea44aa6 (patch) | |
tree | ba7cb8aa666bd4ad5ddf1a99d5c7da4c2aa27203 /debian/readdir-hppa-test.c | |
parent | ff07f00bf37b16a834d5e5dec1d052a3e622a306 (diff) | |
download | qt4-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.c | 25 |
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); + } +} + |