#include <getopt.h>
#include <termios.h>
#include <limits.h>
+#include <stddef.h>
#include "log.h"
#include "macro.h"
sa.un.sun_family = AF_UNIX;
snprintf(sa.un.sun_path+1, sizeof(sa.un.sun_path)-1, "/org/freedesktop/systemd1/ask-password/%llu", random_ull());
- if (bind(fd, &sa.sa, sizeof(sa_family_t) + 1 + strlen(sa.un.sun_path+1)) < 0) {
+ if (bind(fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + 1 + strlen(sa.un.sun_path+1)) < 0) {
r = -errno;
log_error("bind() failed: %m");
goto fail;
int fd = -1, r;
FILE *f = NULL;
char *socket_name = NULL;
- int socket_fd, signal_fd;
+ int socket_fd = -1, signal_fd;
sigset_t mask;
usec_t not_after;