1 |
commit: 29afc5efc0ae2cd9977b0b44469d741c1c2066d3 |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Nov 27 20:49:47 2015 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Nov 27 20:49:47 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=29afc5ef |
7 |
|
8 |
qcache: fix ebuild traversal error path |
9 |
|
10 |
We were freeing the wrong vars for this loop. |
11 |
|
12 |
Also do not dump a warning when we try to scan a path that isn't a |
13 |
directory. Random files in there shouldn't cause us to complain. |
14 |
|
15 |
qcache.c | 8 +++++--- |
16 |
1 file changed, 5 insertions(+), 3 deletions(-) |
17 |
|
18 |
diff --git a/qcache.c b/qcache.c |
19 |
index af64bc5..8dbeaa3 100644 |
20 |
--- a/qcache.c |
21 |
+++ b/qcache.c |
22 |
@@ -441,9 +441,11 @@ int qcache_traverse(void (*func)(qcache_data*)) |
23 |
xasprintf(&ebuildpath, "%s/%s/%s", portdir, categories[i]->d_name, packages[j]->d_name); |
24 |
|
25 |
if (-1 == (num_ebuild = scandir(ebuildpath, &ebuilds, qcache_ebuild_select, qcache_vercmp))) { |
26 |
- warnp("%s", ebuildpath); |
27 |
- free(packages[i]); |
28 |
- free(pkgpath); |
29 |
+ /* Do not complain about spurious files */ |
30 |
+ if (errno != ENOTDIR) |
31 |
+ warnp("%s", ebuildpath); |
32 |
+ free(packages[j]); |
33 |
+ free(ebuildpath); |
34 |
continue; |
35 |
} |