X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fmanager.c;h=c26dcaa9996dc97c777d900fee291b870effc21c;hb=96415cad2fdd8d280ae94b02651b5f826a2f7f3d;hp=b9aa6dcfd56fa957485485603707b10c2d8fc776;hpb=d86f9d5285742e959a158e743799506b5339fefc;p=elogind.git diff --git a/src/core/manager.c b/src/core/manager.c index b9aa6dcfd..c26dcaa99 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -482,7 +482,7 @@ static int manager_setup_notify(Manager *m) { } if (getpid() != 1 || detect_container(NULL) > 0) - snprintf(sa.un.sun_path, sizeof(sa.un.sun_path), NOTIFY_SOCKET "/%llu", random_ull()); + snprintf(sa.un.sun_path, sizeof(sa.un.sun_path), NOTIFY_SOCKET "/%" PRIx64, random_u64()); else strncpy(sa.un.sun_path, NOTIFY_SOCKET, sizeof(sa.un.sun_path)); sa.un.sun_path[0] = 0; @@ -2208,8 +2208,10 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) { if (safe_atoi(l + 10, &fd) < 0 || fd < 0 || !fdset_contains(fds, fd)) log_debug("Failed to parse notify fd: %s", l + 10); else { - if (m->notify_fd >= 0) + if (m->notify_fd >= 0) { + m->notify_event_source = sd_event_source_unref(m->notify_event_source); close_nointr_nofail(m->notify_fd); + } m->notify_fd = fdset_remove(fds, fd); }