This is the smallest possible fix for OpenVZ, where cached is not available.
master has a more complete fix which should be used going forward.
Fixes: #733
fclose (fh);
- if (have_data != 0x07)
+ if ((have_data & 0x03) != 0x03)
return (ENOENT);
if (isnan (swap_total)
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 */