Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Jun 1999 11:59:17 +0200
From:      Sheldon Hearn <sheldonh@uunet.co.za>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/12076: [PATCH] Fix sysutils/xosview build error
Message-ID:  <53367.928835957@axl.noc.iafrica.com>

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

>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 <sys/param.h>		/*  For things in sys/conf.h.  */
+ #include <sys/conf.h>		/*  For struct swdevt.  */
+ #ifdef XOSVIEW_FREEBSD
++#ifndef USE_KVM_GETSWAPINFO
+ #include <sys/rlist.h>
++#endif
+ #else
+ #include <sys/map.h>		/*  For struct mapent.  */
  #endif
+@@ -77,6 +79,9 @@
+ #endif
  #include <stdlib.h>		/*  For malloc().  */
  #include <string.h>		/*  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




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