commit: 40335ce6a4577e520a612d7061dadf5c9b2e8b01
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 22 19:37:53 2020 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Wed Jan 22 19:37:53 2020 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=40335ce6
qpkg: fix Coverity 125897 Unchecked return value
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
qpkg.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/qpkg.c b/qpkg.c
index 4519e9c..7835cd7 100644
--- a/qpkg.c
+++ b/qpkg.c
@@ -356,8 +356,7 @@ int qpkg_main(int argc, char **argv)
err("'%s' is not a valid package destination", qpkg_bindir);
for (i = 0; i <= 1; i++) {
if (mkdir(qpkg_bindir, 0750) == -1) {
- lstat(qpkg_bindir, &st);
- if (!S_ISDIR(st.st_mode)) {
+ if (lstat(qpkg_bindir, &st) == 0 &&
!S_ISDIR(st.st_mode)) {
unlink(qpkg_bindir);
continue;
}