Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/check_varnish.c b/check_varnish.c
- index 05ca41a..19ce5dd 100644
- --- a/check_varnish.c
- +++ b/check_varnish.c
- @@ -165,7 +165,7 @@ check_thresholds(intmax_t value)
- * Check the statistics for the requested parameter.
- */
- static void
- -check_stats(const struct vsc_main *stats, char *param)
- +check_stats(const struct VSC_C_main *stats, char *param)
- {
- const char *info;
- struct timeval tv;
- @@ -180,18 +180,20 @@ check_stats(const struct vsc_main *stats, char *param)
- info = "Cache hit ratio";
- }
- else if (strcmp(param, "usage") == 0) {
- - intmax_t total = stats->sm_balloc + stats->sm_bfree;
- + intmax_t total = stats->sms_balloc + stats->sms_bfree;
- - value = total ? (100 * stats->sm_balloc / total) : 0;
- + value = total ? (100 * stats->sms_balloc / total) : 0;
- info = "Cache file usage";
- }
- -#define VSC_F_MAIN(n, t, l, f, e) \
- +#define VSC_DO_MAIN
- +#define VSC_F(n, t, l, f, e) \
- else if (strcmp(param, #n) == 0) { \
- value = stats->n; \
- info = e; \
- }
- #include "vsc_fields.h"
- -#undef VSC_F_MAIN
- +#undef VSC_F
- +#undef VSC_DO_MAIN
- else
- printf("Unknown parameter '%s'\n", param);
- @@ -243,7 +245,7 @@ main(int argc, char **argv)
- {
- struct VSM_data *vd;
- const char *n_arg = NULL;
- - const struct vsc_main *VSC_main;
- + const struct VSC_C_main *VSC_main;
- char *param = NULL;
- int opt;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement