chiark / gitweb /
remove unused variable
[elogind.git] / src / reply-password / reply-password.c
index a935d0f08401fe9794f0870083270b5ebdd273e3..2f168985b42f620b02693810a13714a108274857 100644 (file)
@@ -41,14 +41,14 @@ static int send_on_socket(int fd, const char *socket_name, const void *packet, s
         union {
                 struct sockaddr sa;
                 struct sockaddr_un un;
-        } sa;
+        } sa = {
+                .un.sun_family = AF_UNIX,
+        };
 
         assert(fd >= 0);
         assert(socket_name);
         assert(packet);
 
-        zero(sa);
-        sa.un.sun_family = AF_UNIX;
         strncpy(sa.un.sun_path, socket_name, sizeof(sa.un.sun_path));
 
         if (sendto(fd, packet, size, MSG_NOSIGNAL, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(socket_name)) < 0) {