summaryrefslogtreecommitdiff
path: root/src/core/socket.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-10-25 13:14:12 +0100
committerLennart Poettering <lennart@poettering.net>2015-10-25 13:19:18 +0100
commit3ffd4af22052963e7a29431721ee204e634bea75 (patch)
treefe60142dfddd37cfc02b7a135542107e772b36c3 /src/core/socket.c
parent04c0136989b7eb896bfb0fb176e11233d69e1453 (diff)
util-lib: split out fd-related operations into fd-util.[ch]
There are more than enough to deserve their own .c file, hence move them over.
Diffstat (limited to 'src/core/socket.c')
-rw-r--r--src/core/socket.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/socket.c b/src/core/socket.c
index cfa17b3325..e2085dac1c 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -37,6 +37,7 @@
#include "dbus-socket.h"
#include "def.h"
#include "exit-status.h"
+#include "fd-util.h"
#include "formats-util.h"
#include "label.h"
#include "log.h"
@@ -108,11 +109,9 @@ static void socket_unwatch_control_pid(Socket *s) {
}
static void socket_cleanup_fd_list(SocketPort *p) {
- int k = p->n_auxiliary_fds;
-
- while (k--)
- safe_close(p->auxiliary_fds[k]);
+ assert(p);
+ close_many(p->auxiliary_fds, p->n_auxiliary_fds);
p->auxiliary_fds = mfree(p->auxiliary_fds);
p->n_auxiliary_fds = 0;
}