From owner-freebsd-ports Mon Aug 26 3:40:17 2002 Delivered-To: freebsd-ports@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BB2C837B400 for ; Mon, 26 Aug 2002 03:40:06 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 14EF043E77 for ; Mon, 26 Aug 2002 03:40:06 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g7QAe5JU002496 for ; Mon, 26 Aug 2002 03:40:05 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g7QAe5OU002495; Mon, 26 Aug 2002 03:40:05 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4718737B400; Mon, 26 Aug 2002 03:33:27 -0700 (PDT) Received: from topaz.mdcc.cx (topaz.mdcc.cx [212.204.230.141]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9425443E4A; Mon, 26 Aug 2002 03:33:26 -0700 (PDT) (envelope-from edwin@mavetju.org) Received: from k7.mavetju (topaz.mdcc.cx [212.204.230.141]) by topaz.mdcc.cx (Postfix) with ESMTP id 0C64F2B914; Mon, 26 Aug 2002 12:33:23 +0200 (CEST) Received: by k7.mavetju (Postfix, from userid 1001) id 4547C6A7124; Mon, 26 Aug 2002 20:33:17 +1000 (EST) Message-Id: <20020826103317.4547C6A7124@k7.mavetju> Date: Mon, 26 Aug 2002 20:33:17 +1000 (EST) From: Edwin Groothuis Reply-To: Edwin Groothuis To: FreeBSD-gnats-submit@FreeBSD.org Cc: maintainer of devel/libgtop2 X-Send-Pr-Version: 3.113 Subject: ports/42028: [patch] devel/libgtop2 displays wrong swap-info Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 42028 >Category: ports >Synopsis: [patch] devel/libgtop2 displays wrong swap-info >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Aug 26 03:40:04 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Edwin Groothuis >Release: FreeBSD 4.5-RELEASE i386 >Organization: - >Environment: System: FreeBSD k7.mavetju 4.5-RELEASE FreeBSD 4.5-RELEASE #3: Mon Mar 11 13:32:05 EST 2002 edwin@k7.mavetju.org:/usr/src/sys/compile/k7 i386 >Description: libgtop2 provides an API between GTK+ applications and the kernel-structures. It returns swap-information, but forgets to multiple it by getpagesize(). >How-To-Repeat: Install sysutils/gnomesystemsmonitor and check the swap-size. Or run this: #include #include #include void swap(void) { glibtop_swap swap; glibtop_get_swap(&swap); printf("SWAP\n"); printf("total: %lld\n",swap.total); printf("used : %lld\n",swap.used ); printf("free : %lld\n",swap.free ); } int main(void) { glibtop_init(); swap(); } gcc -Wall -I/usr/local/include/libgtop-2.0 -L/usr/local/lib -o a a.c -lgtop-2.0 -lgtop_common-2.0 -lgtop_suid_common-2.0 -lgtop_sysdeps-2.0 -lgtop_names-2.0 -lgtop_sysdeps_suid-2.0 && ./a >Fix: Add this file as files/patch-sysdeps::freebsd::swap.c --- sysdeps/freebsd/swap.c-old Mon Aug 26 20:18:07 2002 +++ sysdeps/freebsd/swap.c Mon Aug 26 20:19:18 2002 @@ -369,8 +369,8 @@ buf->flags = _glibtop_sysdeps_swap; - buf->used = kvmsw[nswdev].ksw_used; - buf->total = kvmsw[nswdev].ksw_total; + buf->used = kvmsw[nswdev].ksw_used * getpagesize(); + buf->total = kvmsw[nswdev].ksw_total * getpagesize(); buf->free = buf->total - buf->used; And bump the revision of the port: --- Makefile.old Mon Aug 26 20:24:24 2002 +++ Makefile Mon Aug 26 20:24:33 2002 @@ -7,6 +7,7 @@ PORTNAME= libgtop2 PORTVERSION= 2.0.0 +PORTREVISION= 1 CATEGORIES= devel gnome MASTER_SITES= ${MASTER_SITE_GNOME} MASTER_SITE_SUBDIR= 2.0.0/releases/gnome-2.0-desktop-final >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message