macroize dir_stat_warn

This commit is contained in:
Doug MacEachern 2005-12-14 02:11:54 +00:00
parent 94939e887b
commit f8060d5cf9
1 changed files with 7 additions and 4 deletions

View File

@ -142,6 +142,12 @@ SIGAR_DECLARE(int)sigar_file_attrs_mode_get(sigar_uint64_t permissions)
#define IS_DOTDIR(dir) \
((dir[0] == '.') && (!dir[1] || ((dir[1] == '.') && !dir[2])))
#define DIR_STAT_WARN() \
sigar_log_printf(sigar, SIGAR_LOG_WARN, \
"dir_stat: cannot stat `%s': %s", \
name, \
sigar_strerror(sigar, status))
#if defined(NETWARE)
int sigar_dir_stat_get(sigar_t *sigar,
@ -652,10 +658,7 @@ static int dir_stat_get(sigar_t *sigar,
dir_stat_get(sigar, name,
dirstats, recurse);
if ((status != SIGAR_OK) && do_log) {
sigar_log_printf(sigar, SIGAR_LOG_WARN,
"dir_stat: cannot stat `%s': %s\n",
name,
sigar_strerror(sigar, status));
DIR_STAT_WARN();
}
}
break;