Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Mar 2002 00:06:13 -0500 (EST)
From:      Joe Marcus Clarke <marcus@marcuscom.com>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/35840: [PATCH] Fix build of devel/libgtop on -CURRENT
Message-ID:  <200203130506.g2D56D839598@shumai.marcuscom.com>

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

>Number:         35840
>Category:       ports
>Synopsis:       [PATCH] Fix build of devel/libgtop on -CURRENT
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 12 21:10:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Joe Marcus Clarke
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
MarcusCom, Inc.
>Environment:
System: FreeBSD shumai.marcuscom.com 4.5-STABLE FreeBSD 4.5-STABLE #0: Mon Mar 4 23:37:10 EST 2002 marcus@shumai.marcuscom.com:/usr/obj/usr/src/sys/SHUMAI i386


	
>Description:
libgtop is broken on -CURRENT due to the changes proc stucture.  This patch
corrects the problem.  The __FreeBSD_version isn't exactly accurate, but
it's the best I could find (off by about 2 days).
>How-To-Repeat:
Try to build libgtop on -CURRENT.
>Fix:

	

--- patch-sysdeps::freebsd::proctime.c.patch begins here ---
--- files/patch-sysdeps::freebsd::proctime.c.orig	Tue Oct  2 04:00:21 2001
+++ files/patch-sysdeps::freebsd::proctime.c	Tue Mar 12 23:59:54 2002
@@ -1,8 +1,5 @@
-
-$FreeBSD: ports/devel/libgtop/files/patch-sysdeps::freebsd::proctime.c,v 1.1 2001/10/02 08:00:21 sobomax Exp $
-
---- sysdeps/freebsd/proctime.c.orig	Thu Feb 15 01:48:46 2001
-+++ sysdeps/freebsd/proctime.c	Tue Oct  2 10:58:26 2001
+--- sysdeps/freebsd/proctime.c.orig	Mon Nov 26 17:37:59 2001
++++ sysdeps/freebsd/proctime.c	Tue Feb 26 12:20:24 2002
 @@ -66,14 +66,17 @@
  {
  	quad_t totusec;
@@ -24,7 +21,7 @@
  
  	tot = st + ut + it;
  	if (tot == 0) {
-@@ -81,12 +84,7 @@
+@@ -81,13 +84,12 @@
  		tot = 1;
  	}
  
@@ -35,10 +32,15 @@
 -	 */
 -
 +#if (defined __FreeBSD__)
++#if __FreeBSD_version >= 500030
++	totusec = (u_quad_t) (p->p_runtime.sec * 1000000 + p->p_runtime.frac);
++#else
  	totusec = (u_quad_t) p->p_runtime;
++#endif
  #else
  	sec = p->p_rtime.tv_sec;
-@@ -157,10 +155,10 @@
+ 	usec = p->p_rtime.tv_usec;
+@@ -157,10 +159,10 @@
  	if ((pinfo == NULL) || (count != 1))
  		glibtop_error_io_r (server, "kvm_getprocs (%d)", pid);
  
@@ -52,7 +54,7 @@
  #endif
  
  	buf->frequency = 1000000;
-@@ -192,6 +190,21 @@
+@@ -192,6 +194,21 @@
  
  	buf->flags |= _glibtop_sysdeps_proc_time_user;
  #else
@@ -74,7 +76,7 @@
  	glibtop_suid_enter (server);
  
  	if ((pinfo [0].kp_proc.p_flag & P_INMEM) &&
-@@ -222,6 +235,7 @@
+@@ -222,6 +239,7 @@
  
  			buf->flags = _glibtop_sysdeps_proc_time_user;
  		}
--- patch-sysdeps::freebsd::proctime.c.patch ends here ---


>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?200203130506.g2D56D839598>