From 45368fc65aebc892bff3ab4b3e844512af26b566 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 11 Dec 2024 18:08:26 -0500 Subject: Use zix_remove() everywhere and check its return value --- test/lilv_test_utils.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'test/lilv_test_utils.c') diff --git a/test/lilv_test_utils.c b/test/lilv_test_utils.c index 1cb8d13..ba291d7 100644 --- a/test/lilv_test_utils.c +++ b/test/lilv_test_utils.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -136,19 +137,28 @@ start_bundle(LilvTestEnv* env, return 0; } +static void +remove_temporary(const char* const path) +{ + const ZixStatus st = zix_remove(path); + if (st) { + fprintf(stderr, "Failed to remove '%s' (%s)\n", path, zix_strerror(st)); + } +} + void delete_bundle(LilvTestEnv* env) { if (env->test_content_path) { - zix_remove(env->test_content_path); + remove_temporary(env->test_content_path); } if (env->test_manifest_path) { - zix_remove(env->test_manifest_path); + remove_temporary(env->test_manifest_path); } if (env->test_bundle_path) { - remove(env->test_bundle_path); + remove_temporary(env->test_bundle_path); } zix_free(NULL, env->test_content_path); -- cgit v1.2.1