aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authornovel <novel@FreeBSD.org>2005-04-08 00:52:56 +0800
committernovel <novel@FreeBSD.org>2005-04-08 00:52:56 +0800
commit6cccc46212abb39d8ccbccca6d882cc4e11c251f (patch)
treedd1ed568817220770a34e7b7e2f2ed7fdf271ad2 /sysutils
parent81efcd030b5de416ec1138c6d389aa35f9b080ab (diff)
downloadfreebsd-ports-graphics-6cccc46212abb39d8ccbccca6d882cc4e11c251f.tar.gz
freebsd-ports-graphics-6cccc46212abb39d8ccbccca6d882cc4e11c251f.tar.zst
freebsd-ports-graphics-6cccc46212abb39d8ccbccca6d882cc4e11c251f.zip
Fix segfault when there is no swap.
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/torsmo/Makefile2
-rw-r--r--sysutils/torsmo/files/patch-torsmo.c16
2 files changed, 14 insertions, 4 deletions
diff --git a/sysutils/torsmo/Makefile b/sysutils/torsmo/Makefile
index ff11d34c9e4..ac024beedc5 100644
--- a/sysutils/torsmo/Makefile
+++ b/sysutils/torsmo/Makefile
@@ -7,7 +7,7 @@
PORTNAME= torsmo
PORTVERSION= 0.18
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
diff --git a/sysutils/torsmo/files/patch-torsmo.c b/sysutils/torsmo/files/patch-torsmo.c
index d0c476dd6b2..fdb9b3b2f7b 100644
--- a/sysutils/torsmo/files/patch-torsmo.c
+++ b/sysutils/torsmo/files/patch-torsmo.c
@@ -1,5 +1,5 @@
--- torsmo.c.orig Wed Dec 22 01:14:46 2004
-+++ torsmo.c Wed Dec 22 21:49:27 2004
++++ torsmo.c Thu Apr 7 20:51:01 2005
@@ -272,7 +272,7 @@
snprintf(buf, 255, "%.1fM", m);
}
@@ -18,7 +18,17 @@
}
OBJ(freq) {
snprintf(p, n, "%s", get_freq());
-@@ -2223,8 +2223,8 @@
+@@ -1126,7 +1126,8 @@
+ human_readable(cur->swapmax*1024, p);
+ }
+ OBJ(swapperc) {
+- snprintf(p, 255, "%*u", pad_percents, (cur->swap*100) / cur->swapmax);
++ snprintf(p, 255, "%*u", pad_percents,
++ cur->swapmax ? (cur->swap*100) / cur->swapmax : 0);
+ }
+ OBJ(swapbar) {
+ new_bar(p, obj->data.pair.a, obj->data.pair.b,
+@@ -2223,8 +2224,8 @@
/* handle other command line arguments */
@@ -29,7 +39,7 @@
while (1) {
int c = getopt(argc, argv, getopt_string);
if(c == -1) break;
-@@ -2319,8 +2319,7 @@
+@@ -2319,8 +2320,7 @@
default:
fprintf(stderr, "torsmo: forked to background, pid is %d\n", ret);