chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
manager: drop all pending jobs when isolating
[elogind.git]
/
src
/
tty-ask-password-agent.c
diff --git
a/src/tty-ask-password-agent.c
b/src/tty-ask-password-agent.c
index a414cba3748c27c16cba6ad82a5fbc2f5a4f7bbb..d7e1ebaef69b79cad16083190972ff982f6b743c 100644
(file)
--- a/
src/tty-ask-password-agent.c
+++ b/
src/tty-ask-password-agent.c
@@
-261,7
+261,6
@@
static int parse_password(const char *filename, char **wall) {
FILE *f;
int r;
FILE *f;
int r;
- usec_t n;
assert(filename);
assert(filename);
@@
-279,14
+278,22
@@
static int parse_password(const char *filename, char **wall) {
goto finish;
}
goto finish;
}
- if (!socket_name
|| not_after <= 0
) {
+ if (!socket_name) {
log_error("Invalid password file %s", filename);
r = -EBADMSG;
goto finish;
}
log_error("Invalid password file %s", filename);
r = -EBADMSG;
goto finish;
}
- n = now(CLOCK_MONOTONIC);
- if (n > not_after) {
+ if (not_after > 0) {
+ if (now(CLOCK_MONOTONIC) > not_after) {
+ r = 0;
+ goto finish;
+ }
+ }
+
+ if (pid > 0 &&
+ kill(pid, 0) < 0 &&
+ errno == ESRCH) {
r = 0;
goto finish;
}
r = 0;
goto finish;
}