chiark / gitweb /
timedated: handle external system time changes
[elogind.git] / src / tty-ask-password-agent / tty-ask-password-agent.c
index c0451c0fd0fabf3daf8faf73a4e7acd1b6b9303d..fa4d660215e72ec6eec70912e3c307fd910a05b1 100644 (file)
@@ -294,9 +294,7 @@ static int parse_password(const char *filename, char **wall) {
                 }
         }
 
-        if (pid > 0 &&
-            kill(pid, 0) < 0 &&
-            errno == ESRCH) {
+        if (pid > 0 && !pid_is_alive(pid)) {
                 r = 0;
                 goto finish;
         }
@@ -363,7 +361,7 @@ static int parse_password(const char *filename, char **wall) {
 
                 } else {
                         int tty_fd = -1;
-                        char *password;
+                        char *password = NULL;
 
                         if (arg_console)
                                 if ((tty_fd = acquire_terminal("/dev/console", false, false, false, (usec_t) -1)) < 0) {
@@ -540,7 +538,7 @@ static int show_passwords(void) {
                 free(p);
 
                 if (wall) {
-                        utmp_wall(wall, wall_tty_match);
+                        utmp_wall(wall, NULL, wall_tty_match);
                         free(wall);
                 }
         }