X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fswap.c;h=d714b5fcdb8d7e558eb02d1c7a787b506bc07230;hb=5c2993e4121feae745551be182221b31bc23ff97;hp=cfde4ea6d2bd9d194abbab16d4d2269e7347e114;hpb=f5adf265a374e5e0dba89a4a9903e7719dc57039;p=collectd.git diff --git a/src/swap.c b/src/swap.c index cfde4ea6..d714b5fc 100644 --- a/src/swap.c +++ b/src/swap.c @@ -82,6 +82,10 @@ static derive_t pagesize; static _Bool report_by_device = 0; /* #endif HAVE_SWAPCTL && HAVE_SWAPCTL_TWO_ARGS */ +#elif HAVE_SWAPCTL && HAVE_SWAPCTL_THREE_ARGS +/* No global variables */ +/* #endif HAVE_SWAPCTL && HAVE_SWAPCTL_THREE_ARGS */ + #elif defined(VM_SWAPUSAGE) /* No global variables */ /* #endif defined(VM_SWAPUSAGE) */ @@ -521,10 +525,10 @@ static int swap_read (void) /* {{{ */ return (0); /* Allocate and initialize the swaptbl_t structure */ - s = (swaptbl_t *) smalloc (swap_num * sizeof (swapent_t) + sizeof (struct swaptable)); + s = malloc (swap_num * sizeof (swapent_t) + sizeof (struct swaptable)); if (s == NULL) { - ERROR ("swap plugin: smalloc failed."); + ERROR ("swap plugin: malloc failed."); return (-1); } @@ -534,7 +538,7 @@ static int swap_read (void) /* {{{ */ s_paths = calloc (swap_num, PATH_MAX); if (s_paths == NULL) { - ERROR ("swap plugin: malloc failed."); + ERROR ("swap plugin: calloc failed."); sfree (s); return (-1); }