--- projects/libstatgrab/src/libstatgrab/disk_stats.c 2004/04/04 22:29:54 1.57 +++ projects/libstatgrab/src/libstatgrab/disk_stats.c 2004/04/04 23:26:23 1.58 @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA * - * $Id: disk_stats.c,v 1.57 2004/04/04 22:29:54 ats Exp $ + * $Id: disk_stats.c,v 1.58 2004/04/04 23:26:23 ats Exp $ */ #ifdef HAVE_CONFIG_H @@ -297,8 +297,7 @@ diskio_stat_t *get_diskio_stats(int *entries){ char *line_ptr; int major, minor; int has_pp_stats = 1; - static partition *parts = NULL; - static int alloc_parts = 0; + VECTOR_DECLARE_STATIC(parts, partition, 16, NULL, NULL); int i, n; time_t now; const char *format; @@ -575,13 +574,8 @@ diskio_stat_t *get_diskio_stats(int *entries){ if (VECTOR_RESIZE(diskio_stats, n + 1) < 0) { goto out; } - if (n >= alloc_parts) { - alloc_parts += 16; - parts = realloc(parts, alloc_parts * sizeof *parts); - if (parts == NULL) { - alloc_parts = 0; - goto out; - } + if (VECTOR_RESIZE(parts, n + 1) < 0) { + goto out; } if (diskio_stats[n].disk_name != NULL)