diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-11-13 11:37:28 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-11-13 11:37:28 +0000 |
| commit | 7ddd442d60e42139c7cad7347a5c7fb98c27b24b (patch) | |
| tree | 8c77b0284487d621b9a9b931b42d5ae1f28f5f6b /src/libs/zbxsysinfo/linux/inodes.c | |
| parent | 2a8dd93d1095950e0e2b38976ab1207f2e182f9e (diff) | |
| download | zabbix-7ddd442d60e42139c7cad7347a5c7fb98c27b24b.tar.gz zabbix-7ddd442d60e42139c7cad7347a5c7fb98c27b24b.tar.xz zabbix-7ddd442d60e42139c7cad7347a5c7fb98c27b24b.zip | |
More functions to return UINT64 instead of double.
git-svn-id: svn://svn.zabbix.com/trunk@2308 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/libs/zbxsysinfo/linux/inodes.c')
| -rw-r--r-- | src/libs/zbxsysinfo/linux/inodes.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/libs/zbxsysinfo/linux/inodes.c b/src/libs/zbxsysinfo/linux/inodes.c index 7a81d6e6..277d573d 100644 --- a/src/libs/zbxsysinfo/linux/inodes.c +++ b/src/libs/zbxsysinfo/linux/inodes.c @@ -24,7 +24,7 @@ #include "md5.h" -static int get_fs_inodes_stat(char *fs, double *total, double *free, double *usage) +static int get_fs_inodes_stat(char *fs, zbx_uint64_t *total, zbx_uint64_t *free, zbx_uint64_t *usage) { #ifdef HAVE_SYS_STATVFS_H struct statvfs s; @@ -44,17 +44,17 @@ static int get_fs_inodes_stat(char *fs, double *total, double *free, double *usa } if(total) - (*total) = (double)(s.f_files); + (*total) = (zbx_uint64_t)(s.f_files); #ifdef HAVE_SYS_STATVFS_H if(free) - (*free) = (double)(s.f_favail); + (*free) = (zbx_uint64_t)(s.f_favail); if(usage) - (*usage) = (double)(s.f_files - s.f_favail); + (*usage) = (zbx_uint64_t)(s.f_files - s.f_favail); #else if(free) - (*free) = (double)(s.f_ffree); + (*free) = (zbx_uint64_t)(s.f_ffree); if(usage) - (*usage) = (double)(s.f_files - s.f_ffree); + (*usage) = (zbx_uint64_t)(s.f_files - s.f_ffree); #endif return SYSINFO_RET_OK; } @@ -62,7 +62,7 @@ static int get_fs_inodes_stat(char *fs, double *total, double *free, double *usa static int VFS_FS_INODE_USED(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { char mountPoint[MAX_STRING_LEN]; - double value = 0; + zbx_uint64_t value = 0; assert(result); @@ -77,8 +77,8 @@ static int VFS_FS_INODE_USED(const char *cmd, const char *param, unsigned flags, if(get_fs_inodes_stat(mountPoint, NULL, NULL, &value) != SYSINFO_RET_OK) return SYSINFO_RET_FAIL; - result->type |= AR_DOUBLE; - result->dbl = value; + result->type |= AR_UINT64; + result->ui64 = value; return SYSINFO_RET_OK; } @@ -86,7 +86,7 @@ static int VFS_FS_INODE_USED(const char *cmd, const char *param, unsigned flags, static int VFS_FS_INODE_FREE(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { char mountPoint[MAX_STRING_LEN]; - double value = 0; + zbx_uint64_t value = 0; assert(result); @@ -101,8 +101,8 @@ static int VFS_FS_INODE_FREE(const char *cmd, const char *param, unsigned flags, if(get_fs_inodes_stat(mountPoint, NULL, &value, NULL) != SYSINFO_RET_OK) return SYSINFO_RET_FAIL; - result->type |= AR_DOUBLE; - result->dbl = value; + result->type |= AR_UINT64; + result->ui64 = value; return SYSINFO_RET_OK; } @@ -110,7 +110,7 @@ static int VFS_FS_INODE_FREE(const char *cmd, const char *param, unsigned flags, static int VFS_FS_INODE_TOTAL(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { char mountPoint[MAX_STRING_LEN]; - double value = 0; + zbx_uint64_t value = 0; assert(result); @@ -127,8 +127,8 @@ static int VFS_FS_INODE_TOTAL(const char *cmd, const char *param, unsigned flags if(get_fs_inodes_stat(mountPoint, &value, NULL, NULL) != SYSINFO_RET_OK) return SYSINFO_RET_FAIL; - result->type |= AR_DOUBLE; - result->dbl = value; + result->type |= AR_UINT64; + result->ui64 = value; return SYSINFO_RET_OK; } @@ -136,8 +136,8 @@ static int VFS_FS_INODE_TOTAL(const char *cmd, const char *param, unsigned flags static int VFS_FS_INODE_PFREE(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { char mountPoint[MAX_STRING_LEN]; - double tot_val = 0; - double free_val = 0; + zbx_uint64_t tot_val = 0; + zbx_uint64_t free_val = 0; assert(result); @@ -153,7 +153,7 @@ static int VFS_FS_INODE_PFREE(const char *cmd, const char *param, unsigned flags return SYSINFO_RET_FAIL; result->type |= AR_DOUBLE; - result->dbl = (100.0 * free_val) / tot_val; + result->dbl = (100.0 * (double)free_val) / (double)tot_val; return SYSINFO_RET_OK; } @@ -161,8 +161,8 @@ static int VFS_FS_INODE_PFREE(const char *cmd, const char *param, unsigned flags static int VFS_FS_INODE_PUSED(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { char mountPoint[MAX_STRING_LEN]; - double tot_val = 0; - double usg_val = 0; + zbx_uint64_t tot_val = 0; + zbx_uint64_t usg_val = 0; assert(result); @@ -178,7 +178,7 @@ static int VFS_FS_INODE_PUSED(const char *cmd, const char *param, unsigned flags return SYSINFO_RET_FAIL; result->type |= AR_DOUBLE; - result->dbl = (100.0 * usg_val) / tot_val; + result->dbl = (100.0 * (double)usg_val) / (double)tot_val; return SYSINFO_RET_OK; } |
