summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus
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/libsystemd/sd-bus
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/libsystemd/sd-bus')
-rw-r--r--src/libsystemd/sd-bus/bus-container.c2
-rw-r--r--src/libsystemd/sd-bus/bus-socket.c2
-rw-r--r--src/libsystemd/sd-bus/test-bus-chat.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/libsystemd/sd-bus/bus-container.c b/src/libsystemd/sd-bus/bus-container.c
index 2cd0e1f99e..6bd7ad6318 100644
--- a/src/libsystemd/sd-bus/bus-container.c
+++ b/src/libsystemd/sd-bus/bus-container.c
@@ -116,7 +116,7 @@ int bus_container_connect_socket(sd_bus *b) {
}
int bus_container_connect_kernel(sd_bus *b) {
- _cleanup_close_pipe_ int pair[2] = { -1, -1 };
+ _cleanup_close_pair_ int pair[2] = { -1, -1 };
_cleanup_close_ int pidnsfd = -1, mntnsfd = -1, rootfd = -1;
union {
struct cmsghdr cmsghdr;
diff --git a/src/libsystemd/sd-bus/bus-socket.c b/src/libsystemd/sd-bus/bus-socket.c
index bccf501222..2e8f008be4 100644
--- a/src/libsystemd/sd-bus/bus-socket.c
+++ b/src/libsystemd/sd-bus/bus-socket.c
@@ -736,7 +736,7 @@ int bus_socket_exec(sd_bus *b) {
pid = fork();
if (pid < 0) {
- close_pipe(s);
+ safe_close_pair(s);
return -errno;
}
if (pid == 0) {
diff --git a/src/libsystemd/sd-bus/test-bus-chat.c b/src/libsystemd/sd-bus/test-bus-chat.c
index 1b9d98fa75..c0abc7a697 100644
--- a/src/libsystemd/sd-bus/test-bus-chat.c
+++ b/src/libsystemd/sd-bus/test-bus-chat.c
@@ -356,7 +356,7 @@ finish:
sd_bus_error_free(&error);
- close_pipe(pp);
+ safe_close_pair(pp);
return INT_TO_PTR(r);
}