fix .Nm usage, deprecate register, use ANSI string.h stuff

This commit is contained in:
lukem 1997-10-20 03:20:27 +00:00
parent c1bed697d4
commit 87a83d449c
3 changed files with 11 additions and 12 deletions

View File

@ -1,7 +1,6 @@
# $NetBSD: Makefile,v 1.4 1997/07/23 20:09:25 kleink Exp $
# $NetBSD: Makefile,v 1.5 1997/10/20 03:20:27 lukem Exp $
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= who
WARNS= 1
.include <bsd.prog.mk>

View File

@ -1,4 +1,4 @@
.\" $NetBSD: who.1,v 1.8 1997/09/09 07:31:15 jtc Exp $
.\" $NetBSD: who.1,v 1.9 1997/10/20 03:20:28 lukem Exp $
.\"
.\" Copyright (c) 1986, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@ -40,14 +40,14 @@
.Nm who
.Nd display who is logged in
.Sh SYNOPSIS
.Nm who
.Nm
.Op Fl mTuH
.Op Ar file
.Nm who
.Nm ""
.Ar am i
.Sh DESCRIPTION
The
.Nm who
.Nm
utility displays a list of all users currently logged on, showing for
each user the login name, tty name, the date and time of login, and
hostname if not local.
@ -59,7 +59,7 @@ Available options:
Only print information about the current terminal. This is the
.Tn POSIX
way of saying
.Nm who
.Nm
.Ar am i .
.It Fl T
Print a character after the user name indicating the state of the
@ -79,7 +79,7 @@ Write column headings above the regular output.
Returns the invoker's real user name.
.It Ar file
By default,
.Nm who
.Nm
gathers information from the file
.Pa /var/run/utmp .
An alternative

View File

@ -1,4 +1,4 @@
/* $NetBSD: who.c,v 1.5 1997/07/23 20:08:03 kleink Exp $ */
/* $NetBSD: who.c,v 1.6 1997/10/20 03:20:29 lukem Exp $ */
/*
* Copyright (c) 1989, 1993
@ -47,7 +47,7 @@ __COPYRIGHT(
#if 0
static char sccsid[] = "@(#)who.c 8.1 (Berkeley) 6/6/93";
#endif
__RCSID("$NetBSD: who.c,v 1.5 1997/07/23 20:08:03 kleink Exp $");
__RCSID("$NetBSD: who.c,v 1.6 1997/10/20 03:20:29 lukem Exp $");
#endif /* not lint */
#include <sys/types.h>
@ -156,13 +156,13 @@ who_am_i(ufp)
{
struct utmp usr;
struct passwd *pw;
register char *p;
char *p;
char *t;
/* search through the utmp and find an entry for this tty */
if ((p = ttyname(0)) != NULL) {
/* strip any directory component */
if ((t = rindex(p, '/')) != NULL)
if ((t = strrchr(p, '/')) != NULL)
p = t + 1;
while (fread((char *)&usr, sizeof(usr), 1, ufp) == 1)
if (usr.ut_name && !strcmp(usr.ut_line, p)) {