Don't prefix error messages with the program name
Do not escape error codes/error messages for no reason.
This commit is contained in:
parent
f308a58740
commit
1392fce27a
6
chvt.c
6
chvt.c
@ -46,12 +46,12 @@ main(int argc, char *argv[])
|
||||
close(fd);
|
||||
}
|
||||
|
||||
eprintf("chvt: couldn't find a console.\n");
|
||||
eprintf("couldn't find a console.\n");
|
||||
VTfound:
|
||||
if(ioctl(fd, VT_ACTIVATE, n) == -1)
|
||||
eprintf("chvt: VT_ACTIVATE '%d':", n);
|
||||
eprintf("VT_ACTIVATE %d:", n);
|
||||
if(ioctl(fd, VT_WAITACTIVE, n) == -1)
|
||||
eprintf("chvt: VT_WAITACTIVE '%d':", n);
|
||||
eprintf("VT_WAITACTIVE %d:", n);
|
||||
close(fd);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
|
4
who.c
4
who.c
@ -28,7 +28,7 @@ main(int argc, char **argv)
|
||||
mflag = 1;
|
||||
tty = ttyname(STDIN_FILENO);
|
||||
if (!tty)
|
||||
eprintf("who: stdin:");
|
||||
eprintf("ttyname: stdin:");
|
||||
if ((ttmp = strrchr(tty, '/')))
|
||||
tty = ttmp+1;
|
||||
break;
|
||||
@ -43,7 +43,7 @@ main(int argc, char **argv)
|
||||
usage();
|
||||
|
||||
if (!(ufp = fopen("/var/run/utmp", "r")))
|
||||
eprintf("who: '%s':", "/var/run/utmp");
|
||||
eprintf("fopen: %s:", "/var/run/utmp");
|
||||
|
||||
while(fread(&usr, sizeof(usr), 1, ufp) == 1) {
|
||||
if (!*usr.ut_name || !*usr.ut_line ||
|
||||
|
Loading…
Reference in New Issue
Block a user