aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2018-04-18 15:57:51 +0200
committerFabian Groffen <grobian@gentoo.org>2018-04-18 15:57:51 +0200
commit4176ede48eabc7fce958d6d9c5d22154fe122447 (patch)
treed18b19657a1fc9bd857a9cd58fc4471264ea8412
parentqcache: use metadata/md5-cache iso /var/cache/edb/ (diff)
downloadportage-utils-4176ede48eabc7fce958d6d9c5d22154fe122447.tar.gz
portage-utils-4176ede48eabc7fce958d6d9c5d22154fe122447.tar.bz2
portage-utils-4176ede48eabc7fce958d6d9c5d22154fe122447.zip
qcache: make categories counting work properly
-rw-r--r--qcache.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/qcache.c b/qcache.c
index 03bcd05..a3be446 100644
--- a/qcache.c
+++ b/qcache.c
@@ -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