mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-25 06:03:40 +03:00
manager: cast mkdir() result to (void) to make sure coverity is quiet
Also simplify the code a bit by moving mkdir to the common path.
This commit is contained in:
parent
4e143738bf
commit
498e87d6b7
@ -662,11 +662,9 @@ static int manager_setup_notify(Manager *m) {
|
||||
return -errno;
|
||||
}
|
||||
|
||||
if (m->running_as == SYSTEMD_SYSTEM) {
|
||||
if (m->running_as == SYSTEMD_SYSTEM)
|
||||
m->notify_socket = strdup("/run/systemd/notify");
|
||||
if (!m->notify_socket)
|
||||
return log_oom();
|
||||
} else {
|
||||
else {
|
||||
const char *e;
|
||||
|
||||
e = getenv("XDG_RUNTIME_DIR");
|
||||
@ -676,11 +674,11 @@ static int manager_setup_notify(Manager *m) {
|
||||
}
|
||||
|
||||
m->notify_socket = strappend(e, "/systemd/notify");
|
||||
if (!m->notify_socket)
|
||||
return log_oom();
|
||||
|
||||
mkdir_parents_label(m->notify_socket, 0755);
|
||||
}
|
||||
if (!m->notify_socket)
|
||||
return log_oom();
|
||||
|
||||
(void) mkdir_parents_label(m->notify_socket, 0755);
|
||||
|
||||
strncpy(sa.un.sun_path, m->notify_socket, sizeof(sa.un.sun_path)-1);
|
||||
r = bind(fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(sa.un.sun_path));
|
||||
|
Loading…
x
Reference in New Issue
Block a user