From 055f272517306e6877a126e414aa60191b483eba Mon Sep 17 00:00:00 2001 From: Nikolaus Rath Date: Sun, 5 May 2019 13:11:03 -0400 Subject: Added new example filesystem passthrough_hp puts emphasis and performance and correctness, rather than simplicity. --- test/test_syscalls.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'test/test_syscalls.c') diff --git a/test/test_syscalls.c b/test/test_syscalls.c index db4be56..a7e2bc7 100644 --- a/test/test_syscalls.c +++ b/test/test_syscalls.c @@ -67,6 +67,11 @@ static void test_error(const char *func, const char *msg, ...) fprintf(stderr, "\n"); } +static int is_dot_or_dotdot(const char *name) { + return name[0] == '.' && + (name[1] == '\0' || (name[1] == '.' && name[2] == '\0')); +} + static void success(void) { fprintf(stderr, "%s OK\n", testname); @@ -381,10 +386,6 @@ static int check_dir_contents(const char *path, const char **contents) found[i] = 0; cont[i] = contents[i]; } - found[i] = 0; - cont[i++] = "."; - found[i] = 0; - cont[i++] = ".."; cont[i] = NULL; dp = opendir(path); @@ -405,6 +406,8 @@ static int check_dir_contents(const char *path, const char **contents) } break; } + if (is_dot_or_dotdot(de->d_name)) + continue; for (i = 0; cont[i] != NULL; i++) { assert(i < MAX_ENTRIES); if (strcmp(cont[i], de->d_name) == 0) { -- cgit v1.2.3