chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
__thread --> thread_local for C11 compat
[elogind.git]
/
src
/
shared
/
ask-password-api.c
diff --git
a/src/shared/ask-password-api.c
b/src/shared/ask-password-api.c
index 277efd302ef60e3478f5a25c54e8fd9d98189ddc..755abf0b5e4c37279babfefe5aa4b6e1f2613946 100644
(file)
--- a/
src/shared/ask-password-api.c
+++ b/
src/shared/ask-password-api.c
@@
-109,7
+109,6
@@
int ask_password_tty(
}
zero(pollfd);
}
zero(pollfd);
-
pollfd[POLL_TTY].fd = ttyfd >= 0 ? ttyfd : STDIN_FILENO;
pollfd[POLL_TTY].events = POLLIN;
pollfd[POLL_INOTIFY].fd = notify;
pollfd[POLL_TTY].fd = ttyfd >= 0 ? ttyfd : STDIN_FILENO;
pollfd[POLL_TTY].events = POLLIN;
pollfd[POLL_INOTIFY].fd = notify;
@@
-248,8
+247,11
@@
static int create_socket(char **name) {
union {
struct sockaddr sa;
struct sockaddr_un un;
union {
struct sockaddr sa;
struct sockaddr_un un;
- } sa;
- int one = 1, r;
+ } sa = {
+ .un.sun_family = AF_UNIX,
+ };
+ int one = 1;
+ int r = 0;
char *c;
assert(name);
char *c;
assert(name);
@@
-260,8
+262,6
@@
static int create_socket(char **name) {
return -errno;
}
return -errno;
}
- zero(sa);
- sa.un.sun_family = AF_UNIX;
snprintf(sa.un.sun_path, sizeof(sa.un.sun_path)-1, "/run/systemd/ask-password/sck.%llu", random_ull());
RUN_WITH_UMASK(0177) {
snprintf(sa.un.sun_path, sizeof(sa.un.sun_path)-1, "/run/systemd/ask-password/sck.%llu", random_ull());
RUN_WITH_UMASK(0177) {