Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.55 KB | None | 0 0
  1. diff --git a/check_varnish.c b/check_varnish.c
  2. index 05ca41a..19ce5dd 100644
  3. --- a/check_varnish.c
  4. +++ b/check_varnish.c
  5. @@ -165,7 +165,7 @@ check_thresholds(intmax_t value)
  6.   * Check the statistics for the requested parameter.
  7.   */
  8.  static void
  9. -check_stats(const struct vsc_main *stats, char *param)
  10. +check_stats(const struct VSC_C_main *stats, char *param)
  11.  {
  12.         const char *info;
  13.         struct timeval tv;
  14. @@ -180,18 +180,20 @@ check_stats(const struct vsc_main *stats, char *param)
  15.                 info = "Cache hit ratio";
  16.         }
  17.         else if (strcmp(param, "usage") == 0) {
  18. -               intmax_t total = stats->sm_balloc + stats->sm_bfree;
  19. +               intmax_t total = stats->sms_balloc + stats->sms_bfree;
  20.  
  21. -               value = total ? (100 * stats->sm_balloc / total) : 0;
  22. +               value = total ? (100 * stats->sms_balloc / total) : 0;
  23.                 info = "Cache file usage";
  24.         }
  25. -#define VSC_F_MAIN(n, t, l, f, e)         \
  26. +#define VSC_DO_MAIN
  27. +#define VSC_F(n, t, l, f, e)      \
  28.         else if (strcmp(param, #n) == 0) { \
  29.                 value = stats->n; \
  30.                 info = e; \
  31.         }
  32.  #include "vsc_fields.h"
  33. -#undef VSC_F_MAIN
  34. +#undef VSC_F
  35. +#undef VSC_DO_MAIN
  36.         else
  37.                 printf("Unknown parameter '%s'\n", param);
  38.  
  39. @@ -243,7 +245,7 @@ main(int argc, char **argv)
  40.  {
  41.         struct VSM_data *vd;
  42.         const char *n_arg = NULL;
  43. -       const struct vsc_main *VSC_main;
  44. +       const struct VSC_C_main *VSC_main;
  45.         char *param = NULL;
  46.         int opt;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement