chiark / gitweb /
agent: don't print warnings if a password was removed or timed out
[elogind.git] / src / tty-ask-password-agent.c
index 14b01486bd4636a942347df45c7df77880f5838e..ee7681a2c8a2fde62667bc98d337a36605213039 100644 (file)
@@ -92,7 +92,7 @@ static int ask_password_plymouth(
         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) {
-                log_error("FAILED TO CONNECT: %m");
+                log_error("Failed to connect to Plymouth: %m");
                 r = -errno;
                 goto finish;
         }
@@ -128,7 +128,7 @@ static int ask_password_plymouth(
                         y = now(CLOCK_MONOTONIC);
 
                         if (y > until) {
-                                r = -ETIMEDOUT;
+                                r = -ETIME;
                                 goto finish;
                         }
 
@@ -149,7 +149,7 @@ static int ask_password_plymouth(
                         r = -errno;
                         goto finish;
                 } else if (j == 0) {
-                        r = -ETIMEDOUT;
+                        r = -ETIME;
                         goto finish;
                 }
 
@@ -375,7 +375,14 @@ static int parse_password(const char *filename, char **wall) {
                         packet_length = strlen(packet);
                 }
 
+                if (r == -ETIME || r == -ENOENT) {
+                        /* If the query went away, that's OK */
+                        r = 0;
+                        goto finish;
+                }
+
                 if (r < 0) {
+
                         log_error("Failed to query password: %s", strerror(-r));
                         goto finish;
                 }