[PATCH] systat -netstat fix

YONETANI Tomokazu qhwt+dfly at les.ath.cx
Fri Nov 12 17:48:33 PST 2004


On Fri, Nov 12, 2004 at 08:17:45PM +0100, Joerg Sonnenberger wrote:
> On Sat, Nov 13, 2004 at 03:26:54AM +0900, YONETANI Tomokazu wrote:
> > And I split off the enhancement as a separate patch, in case
> > you don't like it (contains two patches):
> >  http://les.ath.cx/DragonFly/systat-netstat.tar.gz
> 
> Thanks, I've commited the bugfix. What do you think of the attached
> version of the CPU ID patch? It skips the CPU column if only one
> processor exists.

Thanks.
Yeah, I thought of doing that but didn't have an idea. BTW I noticed an
extra tab in front of `showcpu = 1;', please remove it before you commit it.

> Index: netstat.c
> +	len = sizeof(ncpu);
> +	if (sysctlbyname("hw.ncpu", &ncpu, &len, NULL, 0) == -1) {
> +		warn("cannot determine number of CPUs, assuming SMP");
> +		showcpu = 1;
> +	} else if (ncpu != 1) {
> +			showcpu = 1;
> +	}





More information about the Submit mailing list