filter out MNT_RDONLY mount from file_system_list

This commit is contained in:
Doug MacEachern 2007-04-06 17:41:05 +00:00
parent 43ffe1cc1a
commit 361624c484
1 changed files with 18 additions and 0 deletions

View File

@ -1426,6 +1426,7 @@ int sigar_file_system_list_get(sigar_t *sigar,
struct statfs *fs; struct statfs *fs;
int num, i; int num, i;
long len; long len;
int is_debug = SIGAR_LOG_IS_DEBUG(sigar);
if ((num = getfsstat(NULL, 0, MNT_NOWAIT)) < 0) { if ((num = getfsstat(NULL, 0, MNT_NOWAIT)) < 0) {
return errno; return errno;
@ -1445,6 +1446,23 @@ int sigar_file_system_list_get(sigar_t *sigar,
#ifdef MNT_AUTOMOUNTED #ifdef MNT_AUTOMOUNTED
if (fs[i].f_flags & MNT_AUTOMOUNTED) { if (fs[i].f_flags & MNT_AUTOMOUNTED) {
if (is_debug) {
sigar_log_printf(sigar, SIGAR_LOG_DEBUG,
"[file_system_list] skipping automounted %s: %s",
fs[i].f_fstypename, fs[i].f_mntonname);
}
continue;
}
#endif
#ifdef MNT_RDONLY
if (fs[i].f_flags & MNT_RDONLY) {
/* e.g. ftp mount or .dmg image */
if (is_debug) {
sigar_log_printf(sigar, SIGAR_LOG_DEBUG,
"[file_system_list] skipping readonly %s: %s",
fs[i].f_fstypename, fs[i].f_mntonname);
}
continue; continue;
} }
#endif #endif