chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7dcda35
)
ask-password: use kill(PID, 0) before querying a password
author
Lennart Poettering
<lennart@poettering.net>
Wed, 13 Apr 2011 19:43:36 +0000
(21:43 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 13 Apr 2011 19:43:36 +0000
(21:43 +0200)
src/tty-ask-password-agent.c
patch
|
blob
|
history
diff --git
a/src/tty-ask-password-agent.c
b/src/tty-ask-password-agent.c
index 4a29abacbbcc65e91b7b12c8394071f4312695ac..d7e1ebaef69b79cad16083190972ff982f6b743c 100644
(file)
--- a/
src/tty-ask-password-agent.c
+++ b/
src/tty-ask-password-agent.c
@@
-291,6
+291,13
@@
static int parse_password(const char *filename, char **wall) {
}
}
+ if (pid > 0 &&
+ kill(pid, 0) < 0 &&
+ errno == ESRCH) {
+ r = 0;
+ goto finish;
+ }
+
if (arg_action == ACTION_LIST)
printf("'%s' (PID %u)\n", message, pid);
else if (arg_action == ACTION_WALL) {