From 080c0e53c262691d8d9568edd8fca5197bbc9dac Mon Sep 17 00:00:00 2001 From: Albert S Date: Sat, 15 Jan 2022 19:39:31 +0100 Subject: [PATCH] test: test_mkpath(): Cleanup before run and on success --- test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test.c b/test.c index f860755..c7f37f5 100644 --- a/test.c +++ b/test.c @@ -489,6 +489,7 @@ int test_no_new_fds() int test_mkpath() { + system("rm -rf /tmp/.exile.h/"); const char *filepath = "/tmp/.exile.h/test_mkpath/some/sub/dir/file"; const char *dirpath = "/tmp/.exile.h/test_mkpath/some/other/sub/dir"; int ret = mkpath(filepath, 0700, 1); @@ -527,6 +528,7 @@ int test_mkpath() fprintf(stderr, "Failed: mkpath did not create a directory: %i\n", ret); return 1; } + system("rm -rf /tmp/.exile.h/"); return 0; }