]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
sulogin: clean up error messages
authorKarel Zak <kzak@redhat.com>
Tue, 14 May 2013 21:29:09 +0000 (23:29 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 14 May 2013 21:29:09 +0000 (23:29 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/sulogin.c

index 71308583c33f0401e5479797caf84f347cba561b..32ae9a20d1b101f125036feca2a15ef0471e5d73 100644 (file)
@@ -602,7 +602,7 @@ static char *getpasswd(struct console *con)
                        case ENOENT:
                                break;
                        default:
-                               fprintf(stderr, "sulogin: read(%s): %m\n\r", con->tty);
+                               warn(_("%s: read failed"), con->tty);
                                break;
                        }
                        goto quit;
@@ -868,7 +868,7 @@ int main(int argc, char **argv)
        if (list_empty(&consoles)) {
                if (!errno)
                        errno = ENOENT;
-               errx(EXIT_FAILURE, _("cannot open console: %m\n"));
+               err(EXIT_FAILURE, _("cannot open console"));
        }
 
        /*
@@ -934,7 +934,7 @@ int main(int argc, char **argv)
                                        const char *cryptbuf;
                                        cryptbuf = crypt(answer, passwd);
                                        if (cryptbuf == NULL)
-                                               warnx(_("crypt failed: %m\n"));
+                                               warn(_("crypt failed"));
                                        else if (strcmp(cryptbuf, pwd->pw_passwd) == 0)
                                                doshell++;
                                }
@@ -965,7 +965,7 @@ int main(int argc, char **argv)
                         */
                        exit(0);
                case -1:
-                       warnx(_("Can not fork: %m\n"));
+                       warn(_("fork failed"));
                        /* fall through */
                default:
                        break;