[arch-commits] Commit in htop/trunk (2 files)
Christian Hesse
eworm at archlinux.org
Fri Aug 28 13:36:11 UTC 2020
Date: Friday, August 28, 2020 @ 13:36:11
Author: eworm
Revision: 394834
upgpkg: htop 3.0.0-2: fix battery meter
Added:
htop/trunk/0001-Increae-the-size-of-sysfs-power-supply-path-buffers.patch
Modified:
htop/trunk/PKGBUILD
----------------------------------------------------------------+
0001-Increae-the-size-of-sysfs-power-supply-path-buffers.patch | 32 ++++++++++
PKGBUILD | 10 ++-
2 files changed, 39 insertions(+), 3 deletions(-)
Added: 0001-Increae-the-size-of-sysfs-power-supply-path-buffers.patch
===================================================================
--- 0001-Increae-the-size-of-sysfs-power-supply-path-buffers.patch (rev 0)
+++ 0001-Increae-the-size-of-sysfs-power-supply-path-buffers.patch 2020-08-28 13:36:11 UTC (rev 394834)
@@ -0,0 +1,32 @@
+From b992d52bcf8ff8c51c847cd4bbf33a7db441dbe9 Mon Sep 17 00:00:00 2001
+From: Nathan Scott <nathans at redhat.com>
+Date: Fri, 28 Aug 2020 16:57:21 +1000
+Subject: [PATCH] Increae the size of sysfs power supply path buffers
+
+Resolves https://github.com/htop-dev/htop/issues/15
+---
+ linux/Battery.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/linux/Battery.c b/linux/Battery.c
+index 4014a50..a8784da 100644
+--- a/linux/Battery.c
++++ b/linux/Battery.c
+@@ -107,7 +107,7 @@ static ACPresence procAcpiCheck() {
+ if (entryName[0] != 'A')
+ continue;
+
+- char statePath[50];
++ char statePath[256];
+ xSnprintf((char *) statePath, sizeof statePath, "%s/%s/state", power_supplyPath, entryName);
+ FILE* file = fopen(statePath, "r");
+ if (!file) {
+@@ -191,7 +191,7 @@ static void Battery_getSysData(double* level, ACPresence* isOnAC) {
+ if (!dirEntry)
+ break;
+ char* entryName = (char *) dirEntry->d_name;
+- const char filePath[50];
++ const char filePath[256];
+
+ xSnprintf((char *) filePath, sizeof filePath, SYS_POWERSUPPLY_DIR "/%s/type", entryName);
+ int fd1 = open(filePath, O_RDONLY);
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2020-08-28 13:17:35 UTC (rev 394833)
+++ PKGBUILD 2020-08-28 13:36:11 UTC (rev 394834)
@@ -5,7 +5,7 @@
pkgname=htop
pkgver=3.0.0
-pkgrel=1
+pkgrel=2
pkgdesc='Interactive process viewer'
arch=('x86_64')
url='https://htop.dev/'
@@ -14,12 +14,16 @@
optdepends=('lsof: show files opened by a process'
'strace: attach to a running process')
options=('!emptydirs')
-source=("https://github.com/htop-dev/htop/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz")
-sha256sums=('1c0661f0ae5f4e2874da250b60cd515e4ac4c041583221adfe95f10e18d1a4e6')
+source=("https://github.com/htop-dev/htop/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz"
+ '0001-Increae-the-size-of-sysfs-power-supply-path-buffers.patch')
+sha256sums=('1c0661f0ae5f4e2874da250b60cd515e4ac4c041583221adfe95f10e18d1a4e6'
+ 'e31d8ab3fc41048b9dce0016cbb8facb6d0e62cf4a91c295b99f268cf120f1fc')
prepare() {
cd "$pkgname-$pkgver"
+ patch -Np1 < ../0001-Increae-the-size-of-sysfs-power-supply-path-buffers.patch
+
autoreconf -fi
}
More information about the arch-commits
mailing list