summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorRoman Bogorodskiy <novel@FreeBSD.org>2005-04-07 16:52:56 +0000
committerRoman Bogorodskiy <novel@FreeBSD.org>2005-04-07 16:52:56 +0000
commita34a6612a4828b74e011af1f52e6084d7e3c1d8d (patch)
tree1ceec7f826311728757c254ca95232fda1f6a9f2 /sysutils
parentfix packaging on 4 (diff)
Fix segfault when there is no swap.
Notes
Notes: svn path=/head/; revision=132705
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 ff11d34c9e42..ac024beedc5a 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 d0c476dd6b22..fdb9b3b2f7b2 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);