From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-commits+bounces-855290-garchives=archives.gentoo.org@lists.gentoo.org> Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id EED801384B4 for <garchives@archives.gentoo.org>; Tue, 5 Jan 2016 00:25:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 41F10E0888; Tue, 5 Jan 2016 00:25:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E236EE0888 for <gentoo-commits@lists.gentoo.org>; Tue, 5 Jan 2016 00:25:41 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 84700340545 for <gentoo-commits@lists.gentoo.org>; Tue, 5 Jan 2016 00:25:40 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B01B2C6A for <gentoo-commits@lists.gentoo.org>; Tue, 5 Jan 2016 00:25:38 +0000 (UTC) From: "Mike Frysinger" <vapier@gentoo.org> To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" <vapier@gentoo.org> Message-ID: <1451953490.391b8cf8bb3f06b40d108c157630657132a96131.vapier@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: qcheck.c X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 391b8cf8bb3f06b40d108c157630657132a96131 X-VCS-Branch: master Date: Tue, 5 Jan 2016 00:25:38 +0000 (UTC) Precedence: bulk List-Post: <mailto:gentoo-commits@lists.gentoo.org> List-Help: <mailto:gentoo-commits+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org> X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 92ad00a2-9ec5-4ce4-a710-4a857f65f1ff X-Archives-Hash: affb265b327e257c2e4b5a77a6ea646b commit: 391b8cf8bb3f06b40d108c157630657132a96131 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> AuthorDate: Tue Jan 5 00:24:50 2016 +0000 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> CommitDate: Tue Jan 5 00:24:50 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=391b8cf8 qcheck: improve error reporting for unreadable files We shouldn't flag files that are unreadable as AFK as that implies the files are missing. qcheck.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qcheck.c b/qcheck.c index cdbc507..3718f94 100644 --- a/qcheck.c +++ b/qcheck.c @@ -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;