X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fswap.c;h=1621f7af677a2a83ee866ee752cece72fcea3c60;hb=ea73c57cc68be71f65d6bf491e2299eb88ab6eca;hp=46d3534fcae818cd6fc286cd448d824ad22ccad8;hpb=2979ae00227051ea79c9294ebfaf8337e8e308e2;p=collectd.git diff --git a/src/swap.c b/src/swap.c index 46d3534f..1621f7af 100644 --- a/src/swap.c +++ b/src/swap.c @@ -339,7 +339,7 @@ static int swap_read_combined (void) /* {{{ */ fclose (fh); - if (have_data != 0x07) + if ((have_data & 0x03) != 0x03) return (ENOENT); if (isnan (swap_total) @@ -351,7 +351,8 @@ static int swap_read_combined (void) /* {{{ */ swap_submit_gauge (NULL, "used", 1024.0 * swap_used); swap_submit_gauge (NULL, "free", 1024.0 * swap_free); - swap_submit_gauge (NULL, "cached", 1024.0 * swap_cached); + if (have_data & 0x04) + swap_submit_gauge (NULL, "cached", 1024.0 * swap_cached); return (0); } /* }}} int swap_read_combined */