From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Jan 26 02:20:06 2010 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2FF81065692 for ; Tue, 26 Jan 2010 02:20:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 803A28FC21 for ; Tue, 26 Jan 2010 02:20:06 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o0Q2K63r042941 for ; Tue, 26 Jan 2010 02:20:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id o0Q2K6LT042933; Tue, 26 Jan 2010 02:20:06 GMT (envelope-from gnats) Resent-Date: Tue, 26 Jan 2010 02:20:06 GMT Resent-Message-Id: <201001260220.o0Q2K6LT042933@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Rob Farmer Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6E2B1065670 for ; Tue, 26 Jan 2010 02:16:51 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id D68A68FC0C for ; Tue, 26 Jan 2010 02:16:51 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o0Q2Gplc082685 for ; Tue, 26 Jan 2010 02:16:51 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o0Q2GpU2082684; Tue, 26 Jan 2010 02:16:51 GMT (envelope-from nobody) Message-Id: <201001260216.o0Q2GpU2082684@www.freebsd.org> Date: Tue, 26 Jan 2010 02:16:51 GMT From: Rob Farmer To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/143240: [PATCH] sysutils/nctop utmp.h --> utmpx.h X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2010 02:20:06 -0000 >Number: 143240 >Category: ports >Synopsis: [PATCH] sysutils/nctop utmp.h --> utmpx.h >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Tue Jan 26 02:20:06 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Rob Farmer >Release: 9.0-CURRENT >Organization: >Environment: FreeBSD pentium4.predatorlabs.net 9.0-CURRENT FreeBSD 9.0-CURRENT #0 r202659: Tue Jan 19 16:02:39 PST 2010 rfarmer@pentium4.predatorlabs.net:/obj/usr/src/sys/PENTIUM4 i386 >Description: Convert from utmp.h to utmpx.h >How-To-Repeat: >Fix: Patch attached with submission follows: diff -ruN nctop.old/Makefile nctop/Makefile --- nctop.old/Makefile 2010-01-25 16:45:33.000000000 -0800 +++ nctop/Makefile 2010-01-25 16:57:21.000000000 -0800 @@ -24,4 +24,11 @@ MAN1= nctopd.1 nctop.1 -.include +.include + +.if ${OSVERSION} > 900006 +post-configure: + ${PATCH} ${PATCH_ARGS} machine.c < ${PATCHDIR}/utmpx-machine.c +.endif + +.include diff -ruN nctop.old/files/utmpx-machine.c nctop/files/utmpx-machine.c --- nctop.old/files/utmpx-machine.c 1969-12-31 16:00:00.000000000 -0800 +++ nctop/files/utmpx-machine.c 2010-01-25 16:49:41.000000000 -0800 @@ -0,0 +1,33 @@ +--- machine.c.orig 2010-01-25 16:46:11.000000000 -0800 ++++ machine.c 2010-01-25 16:49:17.000000000 -0800 +@@ -16,7 +16,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include +@@ -101,17 +101,12 @@ + /* nusers */ + { + +- struct utmp utmp; ++ struct utmpx utmp; + +- if ((stream = fopen(_PATH_UTMP,"r")) == NULL) { +- perror(_PATH_UTMP); +- } else { +- for (hoststat.nusers=0; fread(&utmp,sizeof(utmp),1,stream);) { +- if (utmp.ut_name[0] != '\0') { +- ++hoststat.nusers; +- } ++ for (hoststat.nusers=0; fread(&utmp,sizeof(utmp),1,stream);) { ++ if (utmp.ut_user[0] != '\0') { ++ ++hoststat.nusers; + } +- fclose(stream); + } + } + >Release-Note: >Audit-Trail: >Unformatted: