From 6b78bc152962fc88e0bf60ad61e62d21edf90527 Mon Sep 17 00:00:00 2001 From: jasper Date: Thu, 14 Dec 2017 18:03:03 +0000 Subject: [PATCH] when -h is passed don't print any header, as is common practise in other systems too. adjust uptime.1 while here as pointed out by martijn@ ok tb@ jca@ martijn@ --- usr.bin/w/uptime.1 | 8 +++----- usr.bin/w/w.c | 5 +++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/usr.bin/w/uptime.1 b/usr.bin/w/uptime.1 index 83dfad58baa..03bf930dc57 100644 --- a/usr.bin/w/uptime.1 +++ b/usr.bin/w/uptime.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: uptime.1,v 1.14 2007/05/31 19:20:19 jmc Exp $ +.\" $OpenBSD: uptime.1,v 1.15 2017/12/14 18:03:03 jasper Exp $ .\" .\" Copyright (c) 1980, 1990, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)uptime.1 8.2 (Berkeley) 4/18/94 .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: December 14 2017 $ .Dt UPTIME 1 .Os .Sh NAME @@ -44,9 +44,7 @@ utility displays the current time, the length of time the system has been up, the number of users, and the load average of the system over the last 1, 5, and 15 minutes. -This is the -.Dq heading -information from +This is the first line from .Xr w 1 . .Sh SEE ALSO .Xr w 1 diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c index 61cd8ea285a..e85784a49b6 100644 --- a/usr.bin/w/w.c +++ b/usr.bin/w/w.c @@ -1,4 +1,4 @@ -/* $OpenBSD: w.c,v 1.63 2017/07/27 14:17:34 jca Exp $ */ +/* $OpenBSD: w.c,v 1.64 2017/12/14 18:03:03 jasper Exp $ */ /*- * Copyright (c) 1980, 1991, 1993, 1994 @@ -224,7 +224,8 @@ main(int argc, char *argv[]) #define HEADER "USER TTY FROM LOGIN@ IDLE WHAT" #define WUSED (sizeof(HEADER) - sizeof("WHAT")) - (void)puts(HEADER); + if (header) + (void)puts(HEADER); kp = kvm_getprocs(kd, KERN_PROC_ALL, 0, sizeof(*kp), &nentries); if (kp == NULL) -- 2.20.1