X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Ftty-ask-password-agent%2Ftty-ask-password-agent.c;h=276ccf9780e3b7558a1282cf97f7acfae1cf83f8;hb=2826d14091e43ed3397d862dee79d09d0115c84e;hp=2e74a25972ddce27e7c4c6307e83533f414100e5;hpb=c52f663bfa4f420044e6cd25bf84cec3c26ebf6f;p=elogind.git diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c index 2e74a2597..276ccf978 100644 --- a/src/tty-ask-password-agent/tty-ask-password-agent.c +++ b/src/tty-ask-password-agent/tty-ask-password-agent.c @@ -81,6 +81,7 @@ static int ask_password_plymouth( } if (inotify_add_watch(notify, flag_file, IN_ATTRIB /* for the link count */) < 0) { + log_error("Failed to add watch on %s: %m", flag_file); r = -errno; goto finish; } @@ -315,8 +316,7 @@ static int parse_password(const char *filename, char **wall) { *wall ? "\r\n\r\n" : "", message, pid) < 0) { - log_error("Out of memory"); - r = -ENOMEM; + r = log_oom(); goto finish; } @@ -533,8 +533,7 @@ static int show_passwords(void) { continue; if (!(p = strappend("/run/systemd/ask-password/", de->d_name))) { - log_error("Out of memory"); - r = -ENOMEM; + r = log_oom(); goto finish; } @@ -579,6 +578,7 @@ static int watch_passwords(void) { } if (inotify_add_watch(notify, "/run/systemd/ask-password", IN_CLOSE_WRITE|IN_MOVED_TO) < 0) { + log_error("Failed to add watch on /run/systemd/ask-password: %m"); r = -errno; goto finish; } @@ -690,7 +690,6 @@ static int parse_argv(int argc, char *argv[]) { case ARG_VERSION: puts(PACKAGE_STRING); - puts(DISTRIBUTION); puts(SYSTEMD_FEATURES); return 0; @@ -738,6 +737,7 @@ static int parse_argv(int argc, char *argv[]) { int main(int argc, char *argv[]) { int r; + log_set_target(LOG_TARGET_AUTO); log_parse_environment(); log_open();