move fsdev field to sigar_t

This commit is contained in:
Doug MacEachern 2007-11-04 16:29:19 +00:00
parent ddaf40345b
commit 76beb87f73
8 changed files with 5 additions and 17 deletions

View File

@ -70,6 +70,7 @@
char *ifconf_buf; \
int ifconf_len; \
char *self_path; \
sigar_cache_t *fsdev; \
sigar_cache_t *proc_cpu; \
sigar_cache_t *net_listen; \
sigar_cache_t *net_services_tcp; \

View File

@ -49,8 +49,6 @@ int sigar_os_open(sigar_t **sigar)
(*sigar)->pinfo = NULL;
(*sigar)->fsdev = NULL;
(*sigar)->mib = -1;
return SIGAR_OK;
@ -62,9 +60,6 @@ int sigar_os_close(sigar_t *sigar)
if (sigar->pinfo) {
free(sigar->pinfo);
}
if (sigar->fsdev) {
sigar_cache_destroy(sigar->fsdev);
}
if (sigar->mib >= 0) {
close_mib(sigar->mib);
}

View File

@ -43,7 +43,6 @@ struct sigar_t {
sigar_pid_t last_pid;
struct pst_status *pinfo;
sigar_cache_t *fsdev;
int mib;
};

View File

@ -168,8 +168,6 @@ int sigar_os_open(sigar_t **sigar)
(*sigar)->iostat = IOSTAT_NONE;
}
(*sigar)->fsdev = NULL;
/* hook for using mirrored /proc/net/tcp file */
(*sigar)->proc_net = getenv("SIGAR_PROC_NET");
@ -178,9 +176,6 @@ int sigar_os_open(sigar_t **sigar)
int sigar_os_close(sigar_t *sigar)
{
if (sigar->fsdev) {
sigar_cache_destroy(sigar->fsdev);
}
free(sigar);
return SIGAR_OK;
}

View File

@ -67,7 +67,6 @@ struct sigar_t {
int ht_enabled;
int lcpu;
linux_iostat_e iostat;
sigar_cache_t *fsdev;
char *proc_net;
};

View File

@ -255,7 +255,6 @@ struct sigar_t {
proc_dirname_func_t pdirname;
proc_exename_func_t pexename;
sigar_cache_t *fsdev;
sigar_cache_t *pargs;
solaris_mib2_t mib2;

View File

@ -115,7 +115,6 @@ int sigar_os_open(sigar_t **sig)
sigar->pfree = NULL;
sigar->pobjname = NULL;
sigar->fsdev = NULL;
sigar->pargs = NULL;
SIGAR_ZERO(&sigar->mib2);
@ -144,9 +143,6 @@ int sigar_os_close(sigar_t *sigar)
if (sigar->plib) {
dlclose(sigar->plib);
}
if (sigar->fsdev) {
sigar_cache_destroy(sigar->fsdev);
}
if (sigar->pargs) {
sigar_cache_destroy(sigar->pargs);
}

View File

@ -48,6 +48,7 @@ SIGAR_DECLARE(int) sigar_open(sigar_t **sigar)
(*sigar)->ptql_re_impl = NULL;
(*sigar)->ptql_re_data = NULL;
(*sigar)->self_path = NULL;
(*sigar)->fsdev = NULL;
(*sigar)->proc_cpu = NULL;
(*sigar)->net_listen = NULL;
(*sigar)->net_services_tcp = NULL;
@ -65,6 +66,9 @@ SIGAR_DECLARE(int) sigar_close(sigar_t *sigar)
if (sigar->self_path) {
free(sigar->self_path);
}
if (sigar->fsdev) {
sigar_cache_destroy(sigar->fsdev);
}
if (sigar->proc_cpu) {
sigar_cache_destroy(sigar->proc_cpu);
}