mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-25 23:21:33 +03:00
tree-wide: port more code to sigkill_wait()
This commit is contained in:
parent
8f03de5323
commit
7950211df3
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user