aboutsummaryrefslogtreecommitdiffstats
path: root/debian/patches/0013-fix-btime-zero.patch
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2021-02-15 11:07:27 +0100
committerDaniel Lange <DLange@git.local>2021-02-15 11:09:35 +0100
commita0746c81eb538ba011cdfcca1a535e2bd41dc044 (patch)
treeb664ccca444b578c17d643da9417c4cfe2ecf2ab /debian/patches/0013-fix-btime-zero.patch
parent3e4e13c5845b7e145c4c74d72e4c010ddb0620cd (diff)
downloaddebian_htop-c81d9f011ef2c5a0f29f208624190621f7f509ee.tar.gz
debian_htop-c81d9f011ef2c5a0f29f208624190621f7f509ee.tar.bz2
debian_htop-c81d9f011ef2c5a0f29f208624190621f7f509ee.zip
Add patches for btime=0 on embedded systems and ZFS meter coloringdebian/3.0.5-5
Diffstat (limited to 'debian/patches/0013-fix-btime-zero.patch')
-rw-r--r--debian/patches/0013-fix-btime-zero.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/debian/patches/0013-fix-btime-zero.patch b/debian/patches/0013-fix-btime-zero.patch
new file mode 100644
index 0000000..451a058
--- /dev/null
+++ b/debian/patches/0013-fix-btime-zero.patch
@@ -0,0 +1,33 @@
+From 7433bf4b18278080fb2ac22c5828490883066570 Mon Sep 17 00:00:00 2001
+From: Nathan Scott <nathans@redhat.com>
+Date: Mon, 15 Feb 2021 19:32:55 +1100
+Subject: [PATCH] Correctly detect failure to initialize boottime
+
+A zero value for btime (boottime) in /proc/stat is a
+real situation that happens, so deal with this case.
+
+Resolves https://github.com/htop-dev/htop/issues/527
+---
+ linux/LinuxProcessList.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/linux/LinuxProcessList.c
++++ b/linux/LinuxProcessList.c
+@@ -64,7 +64,7 @@
+ # define O_PATH 010000000
+ #endif
+
+-static long long btime;
++static long long btime = -1;
+
+ static long jiffy;
+
+@@ -240,7 +240,7 @@
+ }
+ fclose(statfile);
+
+- if (!btime)
++ if (btime == -1)
+ CRT_fatalError("No btime in " PROCSTATFILE);
+ }
+

© 2014-2024 Faster IT GmbH | imprint | privacy policy