summaryrefslogtreecommitdiffstats
path: root/src/import
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-12-20 03:09:08 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-12-20 17:50:33 +0100
commit5bb1d7fbab469b350d132cbbd2c794ffacef1b81 (patch)
treea48b1d5b73e72593b922c67c3946c80121841db0 /src/import
parenttree-wide: introduce PIPE_EBADF macro (diff)
downloadsystemd-5bb1d7fbab469b350d132cbbd2c794ffacef1b81.tar.xz
systemd-5bb1d7fbab469b350d132cbbd2c794ffacef1b81.zip
tree-wide: use -EBADF more
Diffstat (limited to 'src/import')
-rw-r--r--src/import/import-common.c4
-rw-r--r--src/import/pull-common.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/import/import-common.c b/src/import/import-common.c
index b67a49c72d..0e2c7edae1 100644
--- a/src/import/import-common.c
+++ b/src/import/import-common.c
@@ -64,7 +64,7 @@ int import_fork_tar_x(const char *path, pid_t *ret) {
pipefd[1] = safe_close(pipefd[1]);
- r = rearrange_stdio(TAKE_FD(pipefd[0]), -1, STDERR_FILENO);
+ r = rearrange_stdio(TAKE_FD(pipefd[0]), -EBADF, STDERR_FILENO);
if (r < 0) {
log_error_errno(r, "Failed to rearrange stdin/stdout: %m");
_exit(EXIT_FAILURE);
@@ -130,7 +130,7 @@ int import_fork_tar_c(const char *path, pid_t *ret) {
pipefd[0] = safe_close(pipefd[0]);
- r = rearrange_stdio(-1, TAKE_FD(pipefd[1]), STDERR_FILENO);
+ r = rearrange_stdio(-EBADF, TAKE_FD(pipefd[1]), STDERR_FILENO);
if (r < 0) {
log_error_errno(r, "Failed to rearrange stdin/stdout: %m");
_exit(EXIT_FAILURE);
diff --git a/src/import/pull-common.c b/src/import/pull-common.c
index 6e9aade3cf..6980f12a79 100644
--- a/src/import/pull-common.c
+++ b/src/import/pull-common.c
@@ -395,7 +395,7 @@ static int verify_gpg(
return log_error_errno(errno, "Failed to create pipe for gpg: %m");
if (signature_size > 0) {
- _cleanup_close_ int sig_file = -1;
+ _cleanup_close_ int sig_file = -EBADF;
sig_file = mkostemp(sig_file_path, O_RDWR);
if (sig_file < 0)
@@ -440,7 +440,7 @@ static int verify_gpg(
gpg_pipe[1] = safe_close(gpg_pipe[1]);
- r = rearrange_stdio(TAKE_FD(gpg_pipe[0]), -1, STDERR_FILENO);
+ r = rearrange_stdio(TAKE_FD(gpg_pipe[0]), -EBADF, STDERR_FILENO);
if (r < 0) {
log_error_errno(r, "Failed to rearrange stdin/stdout: %m");
_exit(EXIT_FAILURE);