X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fmanager.c;h=4ee04e181fb6c62e47f84232b438761017f8734d;hp=c062cfb5ed3f19fb33bde2d7456843022902c960;hb=0e098b15c76e222f7de381203c0c35a75a5b2f24;hpb=e983b76024342278a0377eae116c925f2567776e diff --git a/src/manager.c b/src/manager.c index c062cfb5e..4ee04e181 100644 --- a/src/manager.c +++ b/src/manager.c @@ -92,7 +92,7 @@ static int manager_setup_notify(Manager *m) { else strncpy(sa.un.sun_path+1, NOTIFY_SOCKET, sizeof(sa.un.sun_path)-1); - if (bind(m->notify_watch.fd, &sa.sa, sizeof(sa_family_t) + 1 + strlen(sa.un.sun_path+1)) < 0) { + if (bind(m->notify_watch.fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + 1 + strlen(sa.un.sun_path+1)) < 0) { log_error("bind() failed: %m"); return -errno; }