[hackers] [ubase] Don't prefix error messages with the program name || sin

From: <git_AT_suckless.org>
Date: Sat, 12 Apr 2014 00:47:36 +0200

commit 1392fce27a91b1df06e4c421af801f225ff67d23
Author: sin <sin_AT_2f30.org>
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
_AT_@ -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
_AT_@ -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;
_AT_@ -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 ||
Received on Sat Apr 12 2014 - 00:47:36 CEST

This archive was generated by hypermail 2.3.0 : Sat Apr 12 2014 - 00:48:15 CEST