summaryrefslogtreecommitdiff
path: root/src/core/dbus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-11-07 16:32:06 +0100
committerLennart Poettering <lennart@poettering.net>2014-11-07 16:36:14 +0100
commitf0e62e89970b8c38eb07a9beebd277ce13a5fcc2 (patch)
tree73f7e0463a8c80779c4b188c9aaf3c89ff96e46a /src/core/dbus.c
parentd48b7bd271b1e70924c8485d2f95c2f5a1ae77cb (diff)
core: unify how we create the notify and private dbus socket
Use the same robust logic of mkdir + unlink of any existing AF_UNIX socket, ignoring the return value, right before bind().
Diffstat (limited to 'src/core/dbus.c')
-rw-r--r--src/core/dbus.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/core/dbus.c b/src/core/dbus.c
index 185057b624..9cb198a13a 100644
--- a/src/core/dbus.c
+++ b/src/core/dbus.c
@@ -974,11 +974,10 @@ static int bus_init_private(Manager *m) {
left = strpcpy(&p, left, "/systemd/private");
salen = sizeof(sa.un) - left;
-
- mkdir_parents_label(sa.un.sun_path, 0755);
}
- unlink(sa.un.sun_path);
+ (void) mkdir_parents_label(sa.un.sun_path, 0755);
+ (void) unlink(sa.un.sun_path);
fd = socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
if (fd < 0) {