From owner-freebsd-ports-bugs@FreeBSD.ORG Mon May 26 21:00:00 2014 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B40ACDDE for ; Mon, 26 May 2014 21:00:00 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90F5C2AC1 for ; Mon, 26 May 2014 21:00:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s4QL00HU085078 for ; Mon, 26 May 2014 21:00:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s4QL00SM085077; Mon, 26 May 2014 21:00:00 GMT (envelope-from gnats) Resent-Date: Mon, 26 May 2014 21:00:00 GMT Resent-Message-Id: <201405262100.s4QL00SM085077@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, Jesse Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A54FC28 for ; Mon, 26 May 2014 20:57:19 +0000 (UTC) Received: from cgiserv.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 079012AA8 for ; Mon, 26 May 2014 20:57:19 +0000 (UTC) Received: from cgiserv.freebsd.org ([127.0.1.6]) by cgiserv.freebsd.org (8.14.8/8.14.8) with ESMTP id s4QKvIeg029092 for ; Mon, 26 May 2014 20:57:18 GMT (envelope-from nobody@cgiserv.freebsd.org) Received: (from nobody@localhost) by cgiserv.freebsd.org (8.14.8/8.14.8/Submit) id s4QKvICq029090; Mon, 26 May 2014 20:57:18 GMT (envelope-from nobody) Message-Id: <201405262057.s4QKvICq029090@cgiserv.freebsd.org> Date: Mon, 26 May 2014 20:57:18 GMT From: Jesse To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: ports/190284: port update: sysutils/cpulimit X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 21:00:00 -0000 >Number: 190284 >Category: ports >Synopsis: port update: sysutils/cpulimit >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Mon May 26 21:00:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Jesse >Release: FreeBSD-10.0 >Organization: RM >Environment: >Description: The following patch brings the cpulimit patch up to date with upstream. This includes a number of bug fixes, a more flexible approach to signals and updated documentation. >How-To-Repeat: >Fix: Patch attached with submission follows: diff -ruN /usr/ports/sysutils/cpulimit/Makefile cpulimit/Makefile --- /usr/ports/sysutils/cpulimit/Makefile 2014-01-22 21:08:56.000000000 -0400 +++ cpulimit/Makefile 2014-05-26 17:37:40.845423090 -0300 @@ -2,7 +2,7 @@ # $FreeBSD: head/sysutils/cpulimit/Makefile 340722 2014-01-22 17:00:46Z mat $ PORTNAME= cpulimit -PORTVERSION= 1.4 +PORTVERSION= 2.2 CATEGORIES= sysutils MASTER_SITES= SF/limitcpu/limitcpu/ @@ -12,7 +12,7 @@ LICENSE= GPLv2 CFLAGS+= -lkvm -Wall -O2 -MANCOMPRESSED= yes +MANCOMPRESSED= no PLIST_FILES= bin/${PORTNAME} MAN1= ${PORTNAME}.1 diff -ruN /usr/ports/sysutils/cpulimit/distinfo cpulimit/distinfo --- /usr/ports/sysutils/cpulimit/distinfo 2014-01-22 21:08:56.000000000 -0400 +++ cpulimit/distinfo 2014-05-26 17:54:12.048412495 -0300 @@ -1,2 +1,2 @@ -SHA256 (cpulimit-1.4.tar.gz) = 48bb37801c83c926bf891ca66927c4c51ed1f2186bb3d61a70b19168d3c576df -SIZE (cpulimit-1.4.tar.gz) = 15950 +SHA256 (cpulimit-2.2.tar.gz) = 3f64daa5c4ab9245fa6ae5b564a2ffb3ae60677785103a207fd5f9c5c4cc29e4 +SIZE (cpulimit-2.2.tar.gz) = 22224 diff -ruN /usr/ports/sysutils/cpulimit/files/patch-Makefile cpulimit/files/patch-Makefile --- /usr/ports/sysutils/cpulimit/files/patch-Makefile 1969-12-31 20:00:00.000000000 -0400 +++ cpulimit/files/patch-Makefile 2014-05-26 17:52:30.891485169 -0300 @@ -0,0 +1,15 @@ +--- ./Makefile.orig 2014-05-26 17:50:50.639513964 -0300 ++++ ./Makefile 2014-05-26 17:51:17.773388294 -0300 +@@ -11,11 +11,8 @@ + minix: + $(CC) -o cpulimit cpulimit.c $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) + +-freebsd: +- $(CC) -o cpulimit cpulimit.c -lrt -DFREEBSD $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) +- + cpulimit: cpulimit.c +- $(CC) -o cpulimit cpulimit.c -lrt -DLINUX $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) ++ $(CC) -o cpulimit cpulimit.c -lrt -lkvm -DFREEBSD $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) + + tests: + $(MAKE) -C test diff -ruN /usr/ports/sysutils/cpulimit/files/patch-cpulimit.c cpulimit/files/patch-cpulimit.c --- /usr/ports/sysutils/cpulimit/files/patch-cpulimit.c 2014-01-22 21:08:56.000000000 -0400 +++ cpulimit/files/patch-cpulimit.c 1969-12-31 20:00:00.000000000 -0400 @@ -1,59 +0,0 @@ ---- ./cpulimit.c.orig 2011-08-12 19:35:36.000000000 -0300 -+++ ./cpulimit.c 2011-08-12 21:31:58.000000000 -0300 -@@ -35,6 +35,15 @@ - #include // for compatibility - - -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+ - //kernel time resolution (inverse of one jiffy interval) in Hertz - //i don't know how to detect it, then define to the default (not very clean!) - #define HZ 100 -@@ -245,6 +254,31 @@ - } - - //get jiffies count from /proc filesystem -+int getjiffies(int pid) -+{ -+ kvm_t *my_kernel = NULL; -+ struct kinfo_proc *process_data = NULL; -+ int processes; -+ int my_jiffies = -1; -+ -+ my_kernel = kvm_open(0, 0, 0, O_RDONLY, "kvm_open"); -+ if (! my_kernel) -+ { -+ printf("Error opening kernel vm. You should be running as root.\n"); -+ return -1; -+ } -+ -+ process_data = kvm_getprocs(my_kernel, KERN_PROC_PID, pid, &processes); -+ if ( (process_data) && (processes >= 1) ) -+ my_jiffies = process_data->ki_runtime; -+ -+ kvm_close(my_kernel); -+ if (my_jiffies >= 0) -+ my_jiffies /= 1000; -+ return my_jiffies; -+} -+ -+/* - int getjiffies(int pid) { - static char stat[20]; - static char buffer[1024]; -@@ -271,6 +305,8 @@ - // could not read info - return -1; - } -+*/ -+ - - //process instant photo - struct process_screenshot { >Release-Note: >Audit-Trail: >Unformatted: