diff options
author | 2016-01-04 19:24:50 -0500 | |
---|---|---|
committer | 2016-01-04 19:24:50 -0500 | |
commit | 391b8cf8bb3f06b40d108c157630657132a96131 (patch) | |
tree | a40bc0959442cc333d2fe193687e41cf78f94322 /qcheck.c | |
parent | cache: avoid memleak warnings (diff) | |
download | portage-utils-391b8cf8bb3f06b40d108c157630657132a96131.tar.gz portage-utils-391b8cf8bb3f06b40d108c157630657132a96131.tar.bz2 portage-utils-391b8cf8bb3f06b40d108c157630657132a96131.zip |
qcheck: improve error reporting for unreadable files
We shouldn't flag files that are unreadable as AFK as that implies the
files are missing.
Diffstat (limited to 'qcheck.c')
-rw-r--r-- | qcheck.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -37,7 +37,7 @@ static const char * const qcheck_opts_help[] = { }; #define qcheck_usage(ret) usage(ret, QCHECK_FLAGS, qcheck_long_opts, qcheck_opts_help, lookup_applet_idx("qcheck")) -#define qcprintf(fmt, args...) if (!state->bad_only) printf(_(fmt), ## args) +#define qcprintf(fmt, args...) do { if (!state->bad_only) printf(_(fmt), ## args); } while (0) struct qcheck_opt_state { int argc; @@ -125,7 +125,10 @@ static int qcheck_process_contents(q_vdb_pkg_ctx *pkg_ctx, struct qcheck_opt_sta if (fstatat(pkg_ctx->cat_ctx->ctx->portroot_fd, e->name + 1, &st, AT_SYMLINK_NOFOLLOW)) { /* make sure file exists */ if (state->chk_afk) { - qcprintf(" %sAFK%s: %s\n", RED, NORM, e->name); + if (errno == ENOENT) + qcprintf(" %sAFK%s: %s\n", RED, NORM, e->name); + else + qcprintf(" %sERROR (%s)%s: %s\n", RED, strerror(errno), NORM, e->name); } else { --num_files; ++num_files_ignored; |