On 12/14/17 13:56, Jasper Lievisse Adriaanse wrote: > On Thu, Dec 14, 2017 at 01:35:18PM +0100, Martijn van Duren wrote: >> Hello Jasper, >> >> On 12/14/17 13:22, Jasper Lievisse Adriaanse wrote: >>> Hi, >>> >>> currently w(1) on OpenBSD differs from other implementations >>> (GNU/Darwin/FreeBSD/SmartOS) in that 'w -h' does print the >>> 'USER TTY FROM ...' header whereas the others don't. >>> >>> Is there a specific reason for it or could this diff below go in? >> >> I don't know about the history to tell you, and I don't particularly >> care about this change either way. >> >> Do note that our uptime(1) says: >> This is the ???heading??? information from w(1). >> >> This has been removed from the FreeBSD uptime manpage. >> So if we want to do the same thing, you should also adjust uptime.1. > That still _is_ the heading information from w(1) when ran without flags so I > don't think uptime.1 needs any changes.
w(1) -h says: "suppress the heading" and uptime(1) says that the uptime is *the* heading. So with your patch we either remove more than the heading, or uptime becomes only part of the heading. Either way it creates an inconsistency. > >>> Index: w.c >>> =================================================================== >>> RCS file: /cvs/src/usr.bin/w/w.c,v >>> retrieving revision 1.63 >>> diff -u -p -r1.63 w.c >>> --- w.c 27 Jul 2017 14:17:34 -0000 1.63 >>> +++ w.c 14 Dec 2017 12:19:34 -0000 >>> @@ -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) >>> >> >