commit 1392fce27a91b1df06e4c421af801f225ff67d23
Author: sin <[email protected]>
Date:   Fri Apr 11 23:45:49 2014 +0100

    Don't prefix error messages with the program name
    
    Do not escape error codes/error messages for no reason.

diff --git a/chvt.c b/chvt.c
index d1e604c..b0087be 100644
--- a/chvt.c
+++ b/chvt.c
@@ -46,12 +46,12 @@ main(int argc, char *argv[])
                close(fd);
        }
 
-       eprintf("chvt: couldn't find a console.
");
+       eprintf("couldn't find a console.
");
 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;
diff --git a/who.c b/who.c
index c46a6ac..1a31af3 100644
--- a/who.c
+++ b/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 ||


Reply via email to