Contents of /trunk/torsmo/patches/torsmo-0.18.noswap.patch
Parent Directory | Revision Log
Revision 153 -
(show annotations)
(download)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 524 byte(s)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 524 byte(s)
-import
1 | --- torsmo.c.orig 2005-02-28 17:03:39.994538136 +0930 |
2 | +++ torsmo.c 2005-02-28 17:06:19.378308120 +0930 |
3 | @@ -1126,7 +1126,11 @@ |
4 | human_readable(cur->swapmax*1024, p); |
5 | } |
6 | OBJ(swapperc) { |
7 | - snprintf(p, 255, "%*u", pad_percents, (cur->swap*100) / cur->swapmax); |
8 | + if (cur->swapmax == 0) { |
9 | + strncpy(p, "No swap", 255); |
10 | + } else { |
11 | + snprintf(p, 255, "%*u", pad_percents, (cur->swap*100) / cur->swapmax); |
12 | + } |
13 | } |
14 | OBJ(swapbar) { |
15 | new_bar(p, obj->data.pair.a, obj->data.pair.b, |