From 8f03de5323c86f2e7ce0884e169e2c7180938fbd Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 3 Nov 2021 15:56:09 +0100 Subject: tree-wide: port various places to use TAKE_PID() --- src/import/export-tar.c | 3 +-- src/import/import-tar.c | 3 +-- src/import/pull-common.c | 3 +-- src/import/pull-tar.c | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) (limited to 'src/import') diff --git a/src/import/export-tar.c b/src/import/export-tar.c index b734c3004a..6dc2e01733 100644 --- a/src/import/export-tar.c +++ b/src/import/export-tar.c @@ -147,8 +147,7 @@ static int tar_export_finish(TarExport *e) { assert(e->tar_fd >= 0); if (e->tar_pid > 0) { - r = wait_for_terminate_and_check("tar", e->tar_pid, WAIT_LOG); - e->tar_pid = 0; + r = wait_for_terminate_and_check("tar", TAKE_PID(e->tar_pid), WAIT_LOG); if (r < 0) return r; if (r != EXIT_SUCCESS) diff --git a/src/import/import-tar.c b/src/import/import-tar.c index bb67862d62..c8916da11a 100644 --- a/src/import/import-tar.c +++ b/src/import/import-tar.c @@ -167,8 +167,7 @@ static int tar_import_finish(TarImport *i) { i->tar_fd = safe_close(i->tar_fd); if (i->tar_pid > 0) { - r = wait_for_terminate_and_check("tar", i->tar_pid, WAIT_LOG); - i->tar_pid = 0; + r = wait_for_terminate_and_check("tar", TAKE_PID(i->tar_pid), WAIT_LOG); if (r < 0) return r; if (r != EXIT_SUCCESS) diff --git a/src/import/pull-common.c b/src/import/pull-common.c index 39067933b5..adb366222d 100644 --- a/src/import/pull-common.c +++ b/src/import/pull-common.c @@ -482,8 +482,7 @@ static int verify_gpg( gpg_pipe[1] = safe_close(gpg_pipe[1]); - r = wait_for_terminate_and_check("gpg", pid, WAIT_LOG_ABNORMAL); - pid = 0; + r = wait_for_terminate_and_check("gpg", TAKE_PID(pid), WAIT_LOG_ABNORMAL); if (r < 0) goto finish; if (r != EXIT_SUCCESS) diff --git a/src/import/pull-tar.c b/src/import/pull-tar.c index 06d336bca9..bce49cf4e5 100644 --- a/src/import/pull-tar.c +++ b/src/import/pull-tar.c @@ -369,8 +369,7 @@ static void tar_pull_job_on_finished(PullJob *j) { pull_job_close_disk_fd(i->settings_job); if (i->tar_pid > 0) { - r = wait_for_terminate_and_check("tar", i->tar_pid, WAIT_LOG); - i->tar_pid = 0; + r = wait_for_terminate_and_check("tar", TAKE_PID(i->tar_pid), WAIT_LOG); if (r < 0) goto finish; if (r != EXIT_SUCCESS) { -- cgit v1.2.1