ubase

suckless linux base utils
git clone git://git.2f30.org/ubase
Log | Files | Refs | README | LICENSE

commit 1392fce27a91b1df06e4c421af801f225ff67d23
parent f308a587400f29391626fe7243256c918cfd120a
Author: sin <sin@2f30.org>
Date:   Fri, 11 Apr 2014 23:45:49 +0100

Don't prefix error messages with the program name

Do not escape error codes/error messages for no reason.

Diffstat:
Mchvt.c | 6+++---
Mwho.c | 4++--
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/chvt.c b/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; diff --git 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 ||