diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-11-03 15:56:09 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-11-03 16:36:09 +0100 |
commit | 8f03de5323c86f2e7ce0884e169e2c7180938fbd (patch) | |
tree | 83fcdd15e58c113537ce59d1d505030ca9475e6f /src/import | |
parent | 883946f0d2a8d8086749636b729719c22c0c0dba (diff) | |
download | systemd-8f03de5323c86f2e7ce0884e169e2c7180938fbd.tar.gz |
tree-wide: port various places to use TAKE_PID()
Diffstat (limited to 'src/import')
-rw-r--r-- | src/import/export-tar.c | 3 | ||||
-rw-r--r-- | src/import/import-tar.c | 3 | ||||
-rw-r--r-- | src/import/pull-common.c | 3 | ||||
-rw-r--r-- | src/import/pull-tar.c | 3 |
4 files changed, 4 insertions, 8 deletions
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) { |