]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
import: use unlink_and_free() + rm_rf_subvolume_and_free() more
authorLennart Poettering <lennart@poettering.net>
Thu, 28 Jan 2021 15:02:13 +0000 (16:02 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 29 Jan 2021 15:40:20 +0000 (16:40 +0100)
src/import/import-raw.c
src/import/import-tar.c

index f6ee86d62570d3f562c5b4b97acd27bac72d7fb5..3b7031daf6ff05e68e5d814fa310945941c514ce 100644 (file)
@@ -64,10 +64,7 @@ RawImport* raw_import_unref(RawImport *i) {
 
         sd_event_unref(i->event);
 
-        if (i->temp_path) {
-                (void) unlink(i->temp_path);
-                free(i->temp_path);
-        }
+        unlink_and_free(i->temp_path);
 
         import_compress_free(&i->compress);
 
index 6baa2f43abffdb535d2c0d2d0702c20702dffad7..c772493ece8c5f225421de78e44e715c0b7fdef6 100644 (file)
@@ -73,10 +73,7 @@ TarImport* tar_import_unref(TarImport *i) {
                 (void) wait_for_terminate(i->tar_pid, NULL);
         }
 
-        if (i->temp_path) {
-                (void) rm_rf(i->temp_path, REMOVE_ROOT|REMOVE_PHYSICAL|REMOVE_SUBVOLUME);
-                free(i->temp_path);
-        }
+        rm_rf_subvolume_and_free(i->temp_path);
 
         import_compress_free(&i->compress);