From owner-svn-ports-head@freebsd.org Fri Oct 9 02:56:51 2015 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E5449D2DE0; Fri, 9 Oct 2015 02:56:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 3C26D68D; Fri, 9 Oct 2015 02:56:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t992uocD010986; Fri, 9 Oct 2015 02:56:50 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t992uokG010984; Fri, 9 Oct 2015 02:56:50 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201510090256.t992uokG010984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 9 Oct 2015 02:56:50 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r398899 - in head/x11/i3status: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2015 02:56:51 -0000 Author: jhb (src,doc committer) Date: Fri Oct 9 02:56:49 2015 New Revision: 398899 URL: https://svnweb.freebsd.org/changeset/ports/398899 Log: Properly check for the charging flag in the returned battery status to determine if the battery is charging. Reviewed by: bapt (maintainer) Differential Revision: https://reviews.freebsd.org/D3849 Added: head/x11/i3status/files/patch-print_battery_info.c (contents, props changed) Modified: head/x11/i3status/Makefile Modified: head/x11/i3status/Makefile ============================================================================== --- head/x11/i3status/Makefile Thu Oct 8 23:21:52 2015 (r398898) +++ head/x11/i3status/Makefile Fri Oct 9 02:56:49 2015 (r398899) @@ -2,7 +2,7 @@ PORTNAME= i3status PORTVERSION= 2.8 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= x11 MASTER_SITES= http://i3wm.org/i3status/ Added: head/x11/i3status/files/patch-print_battery_info.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11/i3status/files/patch-print_battery_info.c Fri Oct 9 02:56:49 2015 (r398899) @@ -0,0 +1,28 @@ +--- src/print_battery_info.c.orig 2014-01-05 03:34:07.000000000 -0800 ++++ src/print_battery_info.c 2015-10-08 13:33:45.452887000 -0700 +@@ -12,6 +12,7 @@ + #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) + #include + #include ++#include + #endif + + #if defined(__OpenBSD__) +@@ -215,7 +216,7 @@ void print_battery_info(yajl_gen json_ge + state = sysctl_rslt; + if (state == 0 && present_rate == 100) + status = CS_FULL; +- else if (state == 0 && present_rate < 100) ++ else if ((state & ACPI_BATT_STAT_CHARGING) && present_rate < 100) + status = CS_CHARGING; + else + status = CS_DISCHARGING; +@@ -227,7 +228,7 @@ void print_battery_info(yajl_gen json_ge + (void)snprintf(percentagebuf, sizeof(percentagebuf), "%02d%%", + present_rate); + +- if (state == 1) { ++ if (state == ACPI_BATT_STAT_DISCHARG) { + int hours, minutes; + minutes = remaining; + hours = minutes / 60;