]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: port more code to sigkill_wait()
authorLennart Poettering <lennart@poettering.net>
Wed, 3 Nov 2021 15:35:44 +0000 (16:35 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 3 Nov 2021 15:36:19 +0000 (16:36 +0100)
src/import/export-tar.c
src/import/import-tar.c
src/import/importd.c
src/import/pull-tar.c

index 6dc2e017331224c59f44b216f84e0599a000f6c5..78f0a7ca75266cdc6c3fdbc46ee4c8d152746846 100644 (file)
@@ -56,10 +56,8 @@ TarExport *tar_export_unref(TarExport *e) {
 
         sd_event_source_unref(e->output_event_source);
 
-        if (e->tar_pid > 1) {
-                (void) kill_and_sigcont(e->tar_pid, SIGKILL);
-                (void) wait_for_terminate(e->tar_pid, NULL);
-        }
+        if (e->tar_pid > 1)
+                sigkill_wait(e->tar_pid);
 
         if (e->temp_path) {
                 (void) btrfs_subvol_remove(e->temp_path, BTRFS_REMOVE_QUOTA);
index c8916da11a31abdfc38559b73c946ae0ab4593ea..35db30de7810bfab255bcf2df86b12ea71332654 100644 (file)
@@ -69,10 +69,8 @@ TarImport* tar_import_unref(TarImport *i) {
 
         sd_event_source_unref(i->input_event_source);
 
-        if (i->tar_pid > 1) {
-                (void) kill_and_sigcont(i->tar_pid, SIGKILL);
-                (void) wait_for_terminate(i->tar_pid, NULL);
-        }
+        if (i->tar_pid > 1)
+                sigkill_wait(i->tar_pid);
 
         rm_rf_subvolume_and_free(i->temp_path);
 
index 86181628d9d6b3200e23a41b681c026c53960733..3e2d8427cb036080ab38d25f6545b4ec0484b8bd 100644 (file)
@@ -126,10 +126,8 @@ static Transfer *transfer_unref(Transfer *t) {
         free(t->format);
         free(t->object_path);
 
-        if (t->pid > 0) {
-                (void) kill_and_sigcont(t->pid, SIGKILL);
-                (void) wait_for_terminate(t->pid, NULL);
-        }
+        if (t->pid > 1)
+                sigkill_wait(t->pid);
 
         safe_close(t->log_fd);
         safe_close(t->stdin_fd);
index bce49cf4e5237e70970e14fb1bab1fe75a92f074..67e06a144583e086efde2f28f9695342a1c8d623 100644 (file)
@@ -71,10 +71,8 @@ TarPull* tar_pull_unref(TarPull *i) {
         if (!i)
                 return NULL;
 
-        if (i->tar_pid > 1) {
-                (void) kill_and_sigcont(i->tar_pid, SIGKILL);
-                (void) wait_for_terminate(i->tar_pid, NULL);
-        }
+        if (i->tar_pid > 1)
+                sigkill_wait(i->tar_pid);
 
         pull_job_unref(i->tar_job);
         pull_job_unref(i->checksum_job);