summaryrefslogtreecommitdiff
path: root/src/core
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/core
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/core')
-rw-r--r--src/core/automount.c2
-rw-r--r--src/core/execute.c4
-rw-r--r--src/core/manager.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/core/automount.c b/src/core/automount.c
index 77d80b2789..65e6d6f179 100644
--- a/src/core/automount.c
+++ b/src/core/automount.c
@@ -532,7 +532,7 @@ static void automount_enter_waiting(Automount *a) {
return;
fail:
- close_pipe(p);
+ safe_close_pair(p);
if (mounted)
repeat_unmount(a->where);
diff --git a/src/core/execute.c b/src/core/execute.c
index a46f25de3b..353f2d1297 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -2629,7 +2629,7 @@ ExecRuntime *exec_runtime_unref(ExecRuntime *r) {
if (r->n_ref <= 0) {
free(r->tmp_dir);
free(r->var_tmp_dir);
- close_pipe(r->netns_storage_socket);
+ safe_close_pair(r->netns_storage_socket);
free(r);
}
@@ -2781,7 +2781,7 @@ void exec_runtime_destroy(ExecRuntime *rt) {
rt->var_tmp_dir = NULL;
}
- close_pipe(rt->netns_storage_socket);
+ safe_close_pair(rt->netns_storage_socket);
}
static const char* const exec_input_table[_EXEC_INPUT_MAX] = {
diff --git a/src/core/manager.c b/src/core/manager.c
index 360a65a492..a3ff85c86e 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -225,8 +225,8 @@ static int manager_watch_idle_pipe(Manager *m) {
static void manager_close_idle_pipe(Manager *m) {
assert(m);
- close_pipe(m->idle_pipe);
- close_pipe(m->idle_pipe + 2);
+ safe_close_pair(m->idle_pipe);
+ safe_close_pair(m->idle_pipe + 2);
}
static int manager_setup_time_change(Manager *m) {