chiark / gitweb /
tree-wide: introduce new SOCKADDR_UN_LEN() macro, and use it everywhere
[elogind.git] / src / login / pam_elogind.c
index 40e246bb06cd6d07f23ece54816931df0f870e94..98dc20134052f5357dc0e2a413a4c69502027aee 100644 (file)
@@ -150,7 +150,7 @@ static int get_seat_from_display(const char *display, const char **seat, uint32_
         if (fd < 0)
                 return -errno;
 
-        if (connect(fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(sa.un.sun_path)) < 0)
+        if (connect(fd, &sa.sa, SOCKADDR_UN_LEN(sa.un)) < 0)
                 return -errno;
 
         r = getpeercred(fd, &ucred);