From f702a007c7c922853829744dfefdd7d81e4b4213 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 24 Feb 2005 06:03:56 +0000 Subject: [PATCH] dont lookup disk entry if stat fails --- src/os/aix/aix_sigar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/os/aix/aix_sigar.c b/src/os/aix/aix_sigar.c index f87bff17..cf4a56a6 100644 --- a/src/os/aix/aix_sigar.c +++ b/src/os/aix/aix_sigar.c @@ -1519,11 +1519,11 @@ static int create_diskmap_v4(sigar_t *sigar) continue; } retval = stat(ptr, &sb); - ent = sigar_cache_get(sigar->diskmap, FSDEV_ID(sb)); if (retval == 0) { aix_diskio_t *diskio = malloc(sizeof(*diskio)); diskio->name = strdup(disk); diskio->addr = -1; + ent = sigar_cache_get(sigar->diskmap, FSDEV_ID(sb)); ent->value = diskio; } } @@ -1583,12 +1583,12 @@ static int create_diskmap_v5(sigar_t *sigar) if ((attr = getattr(ptr->name, "label", 0, &num))) { retval = stat(attr->value, &sb); - ent = sigar_cache_get(sigar->diskmap, FSDEV_ID(sb)); if (retval == 0) { aix_diskio_t *diskio = malloc(sizeof(*diskio)); diskio->name = strdup(disk[i].name); diskio->addr = -1; + ent = sigar_cache_get(sigar->diskmap, FSDEV_ID(sb)); ent->value = diskio; }