From owner-freebsd-ports Tue Jun 8 3:10:23 1999 Delivered-To: freebsd-ports@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 4BFD715166 for ; Tue, 8 Jun 1999 03:10:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id DAA21026; Tue, 8 Jun 1999 03:10:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from axl.noc.iafrica.com (axl.noc.iafrica.com [196.31.1.175]) by hub.freebsd.org (Postfix) with ESMTP id 225861513C for ; Tue, 8 Jun 1999 02:59:18 -0700 (PDT) (envelope-from sheldonh@axl.noc.iafrica.com) Received: from sheldonh (helo=axl.noc.iafrica.com) by axl.noc.iafrica.com with local-esmtp (Exim 3.02 #1) id 10rIf7-000Dsm-00 for FreeBSD-gnats-submit@freebsd.org; Tue, 08 Jun 1999 11:59:17 +0200 Message-Id: <53367.928835957@axl.noc.iafrica.com> Date: Tue, 08 Jun 1999 11:59:17 +0200 From: Sheldon Hearn Reply-To: Sheldon Hearn To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: ports/12076: [PATCH] Fix sysutils/xosview build error Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 12076 >Category: ports >Synopsis: [PATCH] Fix sysutils/xosview build error >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Jun 8 03:10:00 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Sheldon Hearn >Release: FreeBSD 4.0-CURRENT i386 >Organization: UUNET South Africa >Environment: FreeBSD 4.0-CURRENT >Description: My patch for getting xosview's swapmeter working on CURRENT blew up when rlist.h disappeared out from under it on 1999-05-11. The port build blows up on a missing header error. >How-To-Repeat: On a 4.0-CURRENT system more recent than 1999-05-11, do: cd /usr/ports/sysutils/xosview ; make >Fix: The following nasty hack ought to tide us over. I'm not too keen on putting a lot of work into this, since CURRENT's "get info about swap utilization" interface is such a moving target. Index: patches/patch-ag =================================================================== RCS file: /home/ncvs/ports/sysutils/xosview/patches/patch-ag,v retrieving revision 1.1 diff -u -d -r1.1 patch-ag --- patch-ag 1999/05/29 04:41:18 1.1 +++ patch-ag 1999/06/08 09:45:04 @@ -1,7 +1,17 @@ --- bsd/swapinternal.cc.orig Fri Sep 18 17:38:56 1998 +++ bsd/swapinternal.cc Sat May 22 14:22:21 1999 -@@ -77,6 +77,9 @@ +@@ -66,7 +66,9 @@ + #include /* For things in sys/conf.h. */ + #include /* For struct swdevt. */ + #ifdef XOSVIEW_FREEBSD ++#ifndef USE_KVM_GETSWAPINFO + #include ++#endif + #else + #include /* For struct mapent. */ #endif +@@ -77,6 +79,9 @@ + #endif #include /* For malloc(). */ #include /* For bzero(). */ +#ifdef USE_KVM_GETSWAPINFO @@ -10,7 +20,7 @@ -@@ -91,6 +94,11 @@ +@@ -91,6 +96,11 @@ #define swap_kd kd extern kvm_t* swap_kd; @@ -22,7 +32,7 @@ struct nlist syms[] = { { "_swdevt" }, /* list of swap devices and sizes */ #define VM_SWDEVT 0 -@@ -134,14 +142,25 @@ +@@ -134,14 +144,25 @@ printf("cannot read %s: %s", msg, kvm_geterr(swap_kd)); \ return (0); \ } @@ -49,7 +59,7 @@ if (once) return (1); if (kvm_nlist(swap_kd, syms)) { -@@ -185,6 +204,7 @@ +@@ -185,6 +206,7 @@ } KGET1(VM_SWDEVT, sw, (signed) (nswdev * sizeof(*sw)), "swdevt"); #endif /* XOSVIEW_FREEBSD */ @@ -57,7 +67,7 @@ once = 1; return (1); } -@@ -194,6 +214,7 @@ +@@ -194,6 +216,7 @@ int fetchswap() { @@ -65,7 +75,7 @@ struct rlist head; struct rlist *swapptr; -@@ -236,6 +257,9 @@ +@@ -236,6 +259,9 @@ swapptr = head.rl_next; } @@ -75,7 +85,7 @@ return 0; } -@@ -308,6 +332,15 @@ +@@ -308,6 +334,15 @@ int i, avail, npfree, used=0, xsize, xfree; fetchswap(); @@ -91,7 +101,7 @@ avail = npfree = 0; for (i = 0; i < nswdev; i++) { /* -@@ -350,4 +383,5 @@ +@@ -350,4 +385,5 @@ /* Convert from 512-byte blocks to bytes. */ *total = 512*avail; *free = 512*(avail-used); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message