From e888e525020bacf5d5528d09a49bd56e40bf1113 Mon Sep 17 00:00:00 2001 From: Giacomo Tesio Date: Wed, 30 Aug 2017 00:15:50 +0200 Subject: [PATCH] qa: newlib: fix 102-files so that it works with disk based roots (runDisk.sh) --- qa/lib/newlib/102-files.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/qa/lib/newlib/102-files.c b/qa/lib/newlib/102-files.c index f67329f..515391d 100644 --- a/qa/lib/newlib/102-files.c +++ b/qa/lib/newlib/102-files.c @@ -11,34 +11,34 @@ main(int argc, char **argv) DIR *dirp; struct dirent *dp; - dirp = opendir("/"); + dirp = opendir("/usr/glenda"); if(dirp != NULL) - printf("opendir(/): done\n"); + printf("opendir(/usr/glenda): done\n"); else - printf("opendir(/): failed\n"); + printf("opendir(/usr/glenda): failed\n"); while (dirp) { errno = 0; if ((dp = readdir(dirp)) != NULL) { - if (strcmp(dp->d_name, "README.md") == 0) { + if (strcmp(dp->d_name, "readme.acme") == 0) { if(dp->d_type == DT_REG){ ++i; printf("FOUND! "); } } - if (strcmp(dp->d_name, "sys") == 0) { + if (strcmp(dp->d_name, "tmp") == 0) { if(dp->d_type == DT_DIR){ ++i; printf("FOUND! "); } } - printf("%s: %s\n", dp->d_name, dp->d_type == DT_DIR ? "directory" : "regular"); + printf("%s: %s\n", dp->d_name, dp->d_type == DT_DIR ? "directory" : "regular file"); if(i == 2){ closedir(dirp); return 0; } } else { - printf("readdir returned NULL\n"); + printf("readdir returned NULL before finding both readme.acme and tmp/\n"); if (errno == 0) { closedir(dirp); return 1;