Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/w uptime(1) is NOT supposed to always say `1 user'.



details:   https://anonhg.NetBSD.org/src/rev/ef3200c0208e
branches:  trunk
changeset: 536440:ef3200c0208e
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Mon Sep 16 01:49:06 2002 +0000

description:
uptime(1) is NOT supposed to always say `1 user'.

diffstat:

 usr.bin/w/w.c |  20 ++++++++------------
 1 files changed, 8 insertions(+), 12 deletions(-)

diffs (55 lines):

diff -r 29d4d3031a6d -r ef3200c0208e usr.bin/w/w.c
--- a/usr.bin/w/w.c     Mon Sep 16 00:12:54 2002 +0000
+++ b/usr.bin/w/w.c     Mon Sep 16 01:49:06 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: w.c,v 1.50 2002/08/22 14:52:55 christos Exp $  */
+/*     $NetBSD: w.c,v 1.51 2002/09/16 01:49:06 mycroft Exp $   */
 
 /*-
  * Copyright (c) 1980, 1991, 1993, 1994
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)w.c        8.6 (Berkeley) 6/30/94";
 #else
-__RCSID("$NetBSD: w.c,v 1.50 2002/08/22 14:52:55 christos Exp $");
+__RCSID("$NetBSD: w.c,v 1.51 2002/09/16 01:49:06 mycroft Exp $");
 #endif
 #endif /* not lint */
 
@@ -197,14 +197,13 @@
                errx(1, "%s", errbuf);
 
        (void)time(&now);
-       if (wcmd) {
-#ifdef SUPPORT_UTMP
-               setutent();
+
+#ifdef SUPPORT_UTMPX
+       setutxent();
 #endif
 #ifdef SUPPORT_UTMP
-               setutxent();
+       setutent();
 #endif
-       }
 
        if (*argv)
                sel_user = *argv;
@@ -267,15 +266,12 @@
        }
 #endif
 
-       if (wcmd) {
 #ifdef SUPPORT_UTMPX
-               endutxent();
+       endutxent();
 #endif
 #ifdef SUPPORT_UTMP
-               endutent();
+       endutent();
 #endif
-       } else
-               nusers = 1;
 
        if (header || wcmd == 0) {
                pr_header(&now, nusers);



Home | Main Index | Thread Index | Old Index