minor refactor towards recursive dir_stat impl

This commit is contained in:
Doug MacEachern 2005-12-14 01:47:53 +00:00
parent 3e84be001a
commit 7eb8286364

View File

@ -589,9 +589,9 @@ int sigar_link_attrs_get(sigar_t *sigar,
}
}
int sigar_dir_stat_get(sigar_t *sigar,
const char *dir,
sigar_dir_stat_t *dirstats)
static int dir_stat_get(sigar_t *sigar,
const char *dir,
sigar_dir_stat_t *dirstats)
{
char name[SIGAR_PATH_MAX+1];
int len = strlen(dir);
@ -608,8 +608,6 @@ int sigar_dir_stat_get(sigar_t *sigar,
return errno;
}
SIGAR_ZERO(dirstats);
strncpy(name, dir, sizeof(name));
ptr += len;
if (name[len] != '/') {
@ -677,4 +675,12 @@ int sigar_dir_stat_get(sigar_t *sigar,
return SIGAR_OK;
}
int sigar_dir_stat_get(sigar_t *sigar,
const char *dir,
sigar_dir_stat_t *dirstats)
{
SIGAR_ZERO(dirstats);
return dir_stat_get(sigar, dir, dirstats);
}
#endif