Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Jul 1995 17:30:01 -0700
From:      ken@wc206.residence.gatech.edu
To:        freebsd-bugs
Subject:   bin/578: w -h doesn't suppress all headers
Message-ID:  <199507020030.RAA08800@freefall.cdrom.com>
In-Reply-To: Your message of Sat, 1 Jul 1995 20:25:23 -0400 <199507020025.UAA05021@wc206.residence.gatech.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

>Number:         578
>Category:       bin
>Synopsis:       w -h doesn't suppress "USER    TTY"...etc.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs (FreeBSD bugs mailing list)
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul  1 17:30:00 1995
>Originator:     Kenneth D. Merry
>Organization:
Georgia Institute of Technology
>Release:        FreeBSD 2.0-BUILT-19950527 i386
>Environment:

	486-100, FreeBSD 2.0.5 Alpha with a 2.0.5R Kernel

>Description:

	/usr/bin/w -h only suppresses the 'uptime' type header, not the
"USER    TTY FROM              LOGIN@  IDLE WHAT" header.  Under 1.1, the
default behavior was to suppress all headers.  It changed as of 2.0 to the
current behavior.  Looking at the 4.4 BSD-Lite source tree, it seems that
that's where the behavior change came in.  (i.e. it isn't unique to
FreeBSD)


>How-To-Repeat:

	/usr/bin/w -h on any 2.0 or later FreeBSD machine.

>Fix:
		
	This is a simple, one-line fix.  It moves a } down a couple of
lines.  Hopefully I did the diff right....


	
*** w.old	Tue May 30 02:36:12 1995
--- w.c	Sat Jul  1 20:04:25 1995
***************
*** 217,227 ****
  		pr_header(&now, nusers);
  		if (wcmd == 0)
  			exit (0);
- 	}
  
  #define HEADER	"USER    TTY FROM              LOGIN@  IDLE WHAT\n"
  #define WUSED	(sizeof (HEADER) - sizeof ("WHAT\n"))
  	(void)printf(HEADER);
  
  	if ((kp = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nentries)) == NULL)
  		err(1, "%s", kvm_geterr(kd));
--- 217,227 ----
  		pr_header(&now, nusers);
  		if (wcmd == 0)
  			exit (0);
  
  #define HEADER	"USER    TTY FROM              LOGIN@  IDLE WHAT\n"
  #define WUSED	(sizeof (HEADER) - sizeof ("WHAT\n"))
  	(void)printf(HEADER);
+ 	}
  
  	if ((kp = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nentries)) == NULL)
  		err(1, "%s", kvm_geterr(kd));

>Audit-Trail:
>Unformatted:





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199507020030.RAA08800>