diff options
author | David Robillard <d@drobilla.net> | 2024-12-11 18:08:26 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-12-11 19:08:56 -0500 |
commit | 45368fc65aebc892bff3ab4b3e844512af26b566 (patch) | |
tree | fd067f0211a03736b64e2254441a8fa8c2358265 /test/lilv_test_utils.c | |
parent | 8a70f7ab46fa4587a2f3db368f175fa1b8718bfe (diff) | |
download | lilv-45368fc65aebc892bff3ab4b3e844512af26b566.tar.gz lilv-45368fc65aebc892bff3ab4b3e844512af26b566.tar.bz2 lilv-45368fc65aebc892bff3ab4b3e844512af26b566.zip |
Use zix_remove() everywhere and check its return value
Diffstat (limited to 'test/lilv_test_utils.c')
-rw-r--r-- | test/lilv_test_utils.c | 16 |
1 files changed, 13 insertions, 3 deletions
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 <zix/allocator.h> #include <zix/filesystem.h> #include <zix/path.h> +#include <zix/status.h> #include <errno.h> #include <stdbool.h> @@ -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); |