summaryrefslogtreecommitdiffstats
path: root/login-utils
diff options
context:
space:
mode:
authorSami Kerola2012-07-15 10:39:57 +0200
committerKarel Zak2012-07-16 18:18:22 +0200
commit289dcc90234680063a336925a99d1ef04e97cbda (patch)
treecb8656c16143daa406ea9d706406ca12d94d89d3 /login-utils
parenttranslation: unify stat error messages (diff)
downloadkernel-qcow2-util-linux-289dcc90234680063a336925a99d1ef04e97cbda.tar.gz
kernel-qcow2-util-linux-289dcc90234680063a336925a99d1ef04e97cbda.tar.xz
kernel-qcow2-util-linux-289dcc90234680063a336925a99d1ef04e97cbda.zip
translation: unify file open error messages
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'login-utils')
-rw-r--r--login-utils/islocal.c3
-rw-r--r--login-utils/last.c2
-rw-r--r--login-utils/sulogin.c8
-rw-r--r--login-utils/utmpdump.c4
-rw-r--r--login-utils/vipw.c2
5 files changed, 9 insertions, 10 deletions
diff --git a/login-utils/islocal.c b/login-utils/islocal.c
index e23ca44e0..1f8516618 100644
--- a/login-utils/islocal.c
+++ b/login-utils/islocal.c
@@ -84,8 +84,7 @@ int is_local(const char *user)
int rv;
if ((rv = is_local_in_file(user, _PATH_PASSWD)) < 0) {
perror(_PATH_PASSWD);
- fprintf(stderr, _("Failed to open %s for reading, exiting."),
- _PATH_PASSWD);
+ fprintf(stderr, _("cannot open %s"), _PATH_PASSWD);
exit(1);
} else {
return rv;
diff --git a/login-utils/last.c b/login-utils/last.c
index 1b1bee119..77a890abe 100644
--- a/login-utils/last.c
+++ b/login-utils/last.c
@@ -242,7 +242,7 @@ wtmp(void) {
(void)signal(SIGQUIT, onintr);
if ((fd = open(file,O_RDONLY)) < 0)
- err(EXIT_FAILURE, _("%s: open failed"), file);
+ err(EXIT_FAILURE, _("cannot open %s"), file);
fstat(fd, &st);
utl_len = st.st_size;
diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c
index 7750ad957..7ac493be2 100644
--- a/login-utils/sulogin.c
+++ b/login-utils/sulogin.c
@@ -213,7 +213,7 @@ static struct passwd *getrootpwent(int try_manually)
pwd.pw_gid = 0;
if ((fp = fopen(_PATH_PASSWD, "r")) == NULL) {
- warn(_("%s: open failed"), _PATH_PASSWD);
+ warn(_("cannot open %s"), _PATH_PASSWD);
return &pwd;
}
@@ -251,7 +251,7 @@ static struct passwd *getrootpwent(int try_manually)
*/
strcpy(pwd.pw_passwd, "");
if ((fp = fopen(_PATH_SHADOW_PASSWD, "r")) == NULL) {
- warn(_("%s: open failed"), _PATH_PASSWD);
+ warn(_("cannot open %s"), _PATH_PASSWD);
return &pwd;
}
while ((p = fgets(sline, 256, fp)) != NULL) {
@@ -521,7 +521,7 @@ int main(int argc, char **argv)
if (tty || (tty = getenv("CONSOLE"))) {
if ((fd = open(tty, O_RDWR)) < 0) {
- warn(_("%s: open failed"), tty);
+ warn(_("cannot open %s"), tty);
fd = dup(0);
}
@@ -556,7 +556,7 @@ int main(int argc, char **argv)
if (fd > 2)
close(fd);
if ((fd = open(tty, O_RDWR|O_NOCTTY)) < 0)
- warn(_("%s: open failed"), tty);
+ warn(_("cannot open %s"), tty);
else {
ioctl(0, TIOCSCTTY, (char *)1);
tcsetpgrp(fd, ppgrp);
diff --git a/login-utils/utmpdump.c b/login-utils/utmpdump.c
index d907e0207..cb850af13 100644
--- a/login-utils/utmpdump.c
+++ b/login-utils/utmpdump.c
@@ -115,7 +115,7 @@ static void roll_file(const char *filename, off_t *size)
off_t pos;
if (!(fp = fopen(filename, "r")))
- err(EXIT_FAILURE, _("%s: open failed"), filename);
+ err(EXIT_FAILURE, _("cannot open %s"), filename);
if (fstat(fileno(fp), &st) == -1)
err(EXIT_FAILURE, _("%s: stat failed"), filename);
@@ -340,7 +340,7 @@ int main(int argc, char **argv)
filename = argv[optind];
fp = fopen(filename, "r");
if (!fp)
- err(EXIT_FAILURE, _("%s: open failed"), filename);
+ err(EXIT_FAILURE, _("cannot open %s"), filename);
} else {
if (follow)
errx(EXIT_FAILURE, _("following standard input is unsupported"));
diff --git a/login-utils/vipw.c b/login-utils/vipw.c
index a5982813b..33771127a 100644
--- a/login-utils/vipw.c
+++ b/login-utils/vipw.c
@@ -264,7 +264,7 @@ static void edit_file(int is_shadow)
passwd_file = open(orig_file, O_RDONLY, 0);
if (passwd_file < 0)
- err(EXIT_FAILURE, "%s: %s", _("cannot open file"), orig_file);
+ err(EXIT_FAILURE, _("cannot open %s"), orig_file);
tmp_fd = pw_tmpfile(passwd_file);
if (fstat(fileno(tmp_fd), &begin))