From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BA680138350 for ; Sat, 25 Jan 2020 09:03:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 02556E083B; Sat, 25 Jan 2020 09:03:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8476EE083B for ; Sat, 25 Jan 2020 09:03:12 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4AC2834E23C for ; Sat, 25 Jan 2020 09:03:11 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CFB34D7 for ; Sat, 25 Jan 2020 09:03:09 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1579891476.5c74386bd7c9112df90a7e38fcc14db7ea721e55.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: qpkg.c X-VCS-Directories: / X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 5c74386bd7c9112df90a7e38fcc14db7ea721e55 X-VCS-Branch: master Date: Sat, 25 Jan 2020 09:03:09 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b8546df1-03b7-4f9f-bb6f-7c3bd77dd64b X-Archives-Hash: c16d0795d3b037d7c95e0d44396f70b2 commit: 5c74386bd7c9112df90a7e38fcc14db7ea721e55 Author: Fabian Groffen gentoo org> AuthorDate: Fri Jan 24 18:44:36 2020 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Fri Jan 24 18:44:36 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=5c74386b qpkg: fix Coverity 125896 Unchecked return value Signed-off-by: Fabian Groffen gentoo.org> qpkg.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qpkg.c b/qpkg.c index eaca37b..7929018 100644 --- a/qpkg.c +++ b/qpkg.c @@ -308,7 +308,12 @@ qpkg_make(depend_atom *atom) rmdir(tmpdir); - stat(buf, &st); + if (stat(buf, &st) == -1) { + warnp("could not stat '%s': %s", buf strerror(errno)); + free(buf); + return 1; + } + printf("%s%s%s KiB\n", RED, make_human_readable_str(st.st_size, 1, KILOBYTE), NORM);