summaryrefslogtreecommitdiff
path: root/src/shared/pager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-03-24 03:22:44 +0100
committerLennart Poettering <lennart@poettering.net>2014-03-24 03:22:44 +0100
commit3d94f76c99da13e5603831d0b278f8c8c21bcb02 (patch)
tree15b0ccaa3006d76d28b4f23412c5c35ec6494f8e /src/shared/pager.c
parent6a0f1f6d5af7c7300d3db7a0ba2b068f8abd222b (diff)
util: replace close_pipe() with new safe_close_pair()
safe_close_pair() is more like safe_close(), except that it handles pairs of fds, and doesn't make and misleading allusion, as it works similarly well for socketpairs() as for pipe()s...
Diffstat (limited to 'src/shared/pager.c')
-rw-r--r--src/shared/pager.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/shared/pager.c b/src/shared/pager.c
index 55b13d6ff6..002e3aa373 100644
--- a/src/shared/pager.c
+++ b/src/shared/pager.c
@@ -78,7 +78,7 @@ int pager_open(bool jump_to_end) {
if (pager_pid < 0) {
r = -errno;
log_error("Failed to fork pager: %m");
- close_pipe(fd);
+ safe_close_pair(fd);
return r;
}
@@ -87,7 +87,7 @@ int pager_open(bool jump_to_end) {
const char* less_opts;
dup2(fd[0], STDIN_FILENO);
- close_pipe(fd);
+ safe_close_pair(fd);
less_opts = getenv("SYSTEMD_LESS");
if (!less_opts)
@@ -131,7 +131,7 @@ int pager_open(bool jump_to_end) {
return -errno;
}
- close_pipe(fd);
+ safe_close_pair(fd);
return 1;
}