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);