char ***_passphrases) {
int fd = -1, notify = -1;
- union sockaddr_union sa;
+ union sockaddr_union sa = {};
char *packet = NULL;
ssize_t k;
int r, n;
- struct pollfd pollfd[2];
+ struct pollfd pollfd[2] = {};
char buffer[LINE_MAX];
size_t p = 0;
enum {
goto finish;
}
- zero(sa);
sa.sa.sa_family = AF_UNIX;
strncpy(sa.un.sun_path+1, "/org/freedesktop/plymouthd", sizeof(sa.un.sun_path)-1);
if (connect(fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + 1 + strlen(sa.un.sun_path+1)) < 0) {
goto finish;
}
- zero(pollfd);
pollfd[POLL_SOCKET].fd = fd;
pollfd[POLL_SOCKET].events = POLLIN;
pollfd[POLL_INOTIFY].fd = notify;
return -errno;
}
- r = config_parse(filename, f, NULL, config_item_table_lookup, (void*) items, true, NULL);
+ r = config_parse(NULL, filename, f, NULL, config_item_table_lookup, (void*) items, true, false, NULL);
if (r < 0) {
log_error("Failed to parse password file %s: %s", filename, strerror(-r));
goto finish;
*wall ? "\r\n\r\n" : "",
message,
pid) < 0) {
- log_error("Out of memory");
- r = -ENOMEM;
+ r = log_oom();
goto finish;
}
union {
struct sockaddr sa;
struct sockaddr_un un;
- } sa;
+ } sa = {};
size_t packet_length = 0;
assert(arg_action == ACTION_QUERY ||
}
if (arg_plymouth) {
- char **passwords = NULL;
+ _cleanup_strv_free_ char **passwords = NULL;
if ((r = ask_password_plymouth(message, not_after, filename, accept_cached, &passwords)) >= 0) {
char **p;
goto finish;
}
- zero(sa);
sa.un.sun_family = AF_UNIX;
strncpy(sa.un.sun_path, socket_name, sizeof(sa.un.sun_path));
continue;
if (!(p = strappend("/run/systemd/ask-password/", de->d_name))) {
- log_error("Out of memory");
- r = -ENOMEM;
+ r = log_oom();
goto finish;
}
};
int notify = -1, signal_fd = -1, tty_block_fd = -1;
- struct pollfd pollfd[_FD_MAX];
+ struct pollfd pollfd[_FD_MAX] = {};
sigset_t mask;
int r;
goto finish;
}
- zero(pollfd);
pollfd[FD_INOTIFY].fd = notify;
pollfd[FD_INOTIFY].events = POLLIN;
pollfd[FD_SIGNAL].fd = signal_fd;
case ARG_VERSION:
puts(PACKAGE_STRING);
- puts(DISTRIBUTION);
puts(SYSTEMD_FEATURES);
return 0;
int main(int argc, char *argv[]) {
int r;
+ log_set_target(LOG_TARGET_AUTO);
log_parse_environment();
log_open();