diff options
author | Fabian Groffen <grobian@gentoo.org> | 2018-04-18 15:57:51 +0200 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2018-04-18 15:57:51 +0200 |
commit | 4176ede48eabc7fce958d6d9c5d22154fe122447 (patch) | |
tree | d18b19657a1fc9bd857a9cd58fc4471264ea8412 | |
parent | qcache: use metadata/md5-cache iso /var/cache/edb/ (diff) | |
download | portage-utils-4176ede48eabc7fce958d6d9c5d22154fe122447.tar.gz portage-utils-4176ede48eabc7fce958d6d9c5d22154fe122447.tar.bz2 portage-utils-4176ede48eabc7fce958d6d9c5d22154fe122447.zip |
qcache: make categories counting work properly
-rw-r--r-- | qcache.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -747,23 +747,24 @@ qcache_stats(qcache_data *data) runtime = time(NULL); - xasprintf(&catpath, "%s/dep/%s", portedb, data->overlay); + xasprintf(&catpath, "%s/metadata/md5-cache", data->overlay); dir = opendir(catpath); while ((de = readdir(dir))) { /* Look for all the directories in this path. */ -#ifdef DT_UNKNOWN +#if defined(DT_UNKNOWN) && defined(DT_DIR) if (de->d_type == DT_UNKNOWN) #endif { struct stat s; - if (lstat(de->d_name, &s)) + char spath[_Q_PATH_MAX]; + snprintf(spath, sizeof(spath), "%s/%s", catpath, de->d_name); + if (lstat(spath, &s) != 0) continue; if (!S_ISDIR(s.st_mode)) continue; } - -#ifdef DT_DIR - if (de->d_type != DT_DIR) +#if defined(DT_UNKNOWN) && defined(DT_DIR) + else if (de->d_type != DT_DIR) continue; #endif |