aboutsummaryrefslogtreecommitdiff
path: root/qpkg.c
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2020-01-25 13:19:25 +0100
committerFabian Groffen <grobian@gentoo.org>2020-01-25 13:19:25 +0100
commit169ad2331b0a84f8a960402b04077ece57bb35e2 (patch)
tree6a84582d3728e01517a1b02a2be9fe181ca7f2eb /qpkg.c
parentqpkg: change smiley in comment not to upset rediculous style check (diff)
downloadportage-utils-169ad2331b0a84f8a960402b04077ece57bb35e2.tar.gz
portage-utils-169ad2331b0a84f8a960402b04077ece57bb35e2.tar.bz2
portage-utils-169ad2331b0a84f8a960402b04077ece57bb35e2.zip
qpkg: fix Coverity 207883 Error handling issues
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'qpkg.c')
-rw-r--r--qpkg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/qpkg.c b/qpkg.c
index 79245d0..14e51ce 100644
--- a/qpkg.c
+++ b/qpkg.c
@@ -389,7 +389,8 @@ int qpkg_main(int argc, char **argv)
if (fchmod(fd, 0750) < 0)
errp("could not chmod(0750) temp bindir '%s'", qpkg_bindir);
}
- close(fd);
+ if (fd >= 0)
+ close(fd);
/* we have to change to the root so that we can feed the full paths
* to tar when we create the binary package. */