[hackers] [sbase] Remove who(1) from sbase || sin

From: <git_AT_suckless.org>
Date: Fri, 14 Feb 2014 16:08:56 +0100

commit 386aa62b94fd19a5ca77be019c9236c0fec20cb5
Author: sin <sin_AT_2f30.org>
Date: Fri Feb 14 15:04:43 2014 +0000

    Remove who(1) from sbase
    
    It now lives in ubase.

diff --git a/Makefile b/Makefile
index 762d345..9974ae7 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -95,7 +95,6 @@ SRC = \
         sha256sum.c\
         sha512sum.c\
         wc.c \
- who.c \
         xargs.c \
         yes.c
 
diff --git a/who.1 b/who.1
deleted file mode 100644
index 17ec534..0000000
--- a/who.1
+++ /dev/null
_AT_@ -1,28 +0,0 @@
-.TH WHO 1 sbase\-VERSION
-.SH NAME
-who \- print who has logged on
-.SH SYNOPSIS
-.B who
-.RB [ -m ]
-
-.SH DESCRIPTION
-.B who
-prints a list of who has logged on, their controlling tty, and the
-time at which they logged on.
-.SH OPTIONS
-.TP
-.B \-m
-only show users on current tty
-.TP
-.B \-l
-also print LOGIN processes
-
-.SH BUGS
-.B who
-relies on the utmp file to be updated responsibly. This
-doesn't always happen, which can cause who to print completely
-bogus data.
-
-.SH SEE ALSO
-.IR utmp (5)
-
diff --git a/who.c b/who.c
deleted file mode 100644
index f05cf54..0000000
--- a/who.c
+++ /dev/null
_AT_@ -1,63 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <time.h>
-#include <utmp.h>
-#include "util.h"
-
-static void
-usage(void)
-{
- eprintf("usage: who [-ml]
");
-}
-
-int
-main(int argc, char **argv)
-{
- struct utmp usr;
- FILE *ufp;
- char timebuf[sizeof "yyyy-mm-dd hh:mm"];
- char *tty, *ttmp;
- int mflag = 0, lflag = 0;
- time_t t;
-
- ARGBEGIN {
- case 'm':
- mflag = 1;
- tty = ttyname(STDIN_FILENO);
- if (!tty)
- eprintf("who: stdin:");
- if ((ttmp = strrchr(tty, '/')))
- tty = ttmp+1;
- break;
- case 'l':
- lflag = 1;
- break;
- default:
- usage();
- } ARGEND;
-
- if (argc > 0)
- usage();
-
- if (!(ufp = fopen("/var/run/utmp", "r")))
- eprintf("who: '%s':", "/var/run/utmp");
-
- while(fread(&usr, sizeof(usr), 1, ufp) == 1) {
- if (!*usr.ut_name || !*usr.ut_line ||
- usr.ut_line[0] == '~')
- continue;
- if (mflag && strcmp(usr.ut_line, tty))
- continue;
- if (strcmp(usr.ut_name, "LOGIN") == lflag)
- continue;
- t = usr.ut_time;
- strftime(timebuf, sizeof timebuf, "%Y-%m-%d %H:%M", localtime(&t));
- printf("%-8s %-12s %-16s
", usr.ut_name, usr.ut_line, timebuf);
- }
- fclose(ufp);
- return EXIT_SUCCESS;
-}
-
Received on Fri Feb 14 2014 - 16:08:56 CET

This archive was generated by hypermail 2.3.0 : Fri Feb 14 2014 - 16:12:32 CET