From 079759ca57fb0ab913e0eb647e2d73537d6d6e06 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sun, 4 Nov 2007 18:17:57 +0000 Subject: [PATCH] extend FSDEV_ID for use w/ /dev --- include/sigar_private.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/sigar_private.h b/include/sigar_private.h index d41d9eda..f02e4555 100644 --- a/include/sigar_private.h +++ b/include/sigar_private.h @@ -321,7 +321,9 @@ int sigar_group_name_get(sigar_t *sigar, int gid, char *buf, int buflen); SIGAR_DISK_STATS_INIT(&fsusage->disk) /* key used for filesystem (/) -> device (/dev/hda1) mapping */ -#define SIGAR_FSDEV_ID(sb) ((sb).st_ino + (sb).st_dev) +/* and disk_usage cache for service_time */ +#define SIGAR_FSDEV_ID(sb) \ + (S_ISBLK((sb).st_mode) ? (sb).st_rdev : ((sb).st_ino + (sb).st_dev)) #if defined(WIN32) || defined(NETWARE) int sigar_get_iftype(const char *name, int *type, int *inst);