summaryrefslogtreecommitdiff
path: root/src/import/import-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/import/import-common.c')
-rw-r--r--src/import/import-common.c30
1 files changed, 2 insertions, 28 deletions
diff --git a/src/import/import-common.c b/src/import/import-common.c
index a3dc1dde8c..e2de2c2dd0 100644
--- a/src/import/import-common.c
+++ b/src/import/import-common.c
@@ -1,22 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- This file is part of systemd.
-
- Copyright 2015 Lennart Poettering
-
- systemd is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or
- (at your option) any later version.
-
- systemd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
#include <sched.h>
#include <sys/prctl.h>
@@ -117,13 +99,9 @@ int import_fork_tar_x(const char *path, pid_t *ret) {
_exit(EXIT_FAILURE);
}
- pipefd[0] = safe_close(pipefd[0]);
- r = pipefd[1];
- pipefd[1] = -1;
-
*ret = pid;
- return r;
+ return TAKE_FD(pipefd[1]);
}
int import_fork_tar_c(const char *path, pid_t *ret) {
@@ -165,11 +143,7 @@ int import_fork_tar_c(const char *path, pid_t *ret) {
_exit(EXIT_FAILURE);
}
- pipefd[1] = safe_close(pipefd[1]);
- r = pipefd[0];
- pipefd[0] = -1;
-
*ret = pid;
- return r;
+ return TAKE_FD(pipefd[0]);
}