aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2020-06-27 10:59:02 +0200
committerFabian Groffen <grobian@gentoo.org>2020-06-27 10:59:02 +0200
commit958909e44147a89d77fb1e416f20aaa51148a550 (patch)
tree3bd16992eddf9af8fc54fb1b556b6a463daac7e2
parentlibq/tree: fix metadata cache after realloc (diff)
downloadportage-utils-958909e44147a89d77fb1e416f20aaa51148a550.tar.gz
portage-utils-958909e44147a89d77fb1e416f20aaa51148a550.tar.bz2
portage-utils-958909e44147a89d77fb1e416f20aaa51148a550.zip
qpkg: don't fail when pkgdir doesn't exist yet
When we implicitly created pkgdir, also try to chmod it, instead of failing on permissions later. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
-rw-r--r--qpkg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/qpkg.c b/qpkg.c
index 1494b450..5e554068 100644
--- a/qpkg.c
+++ b/qpkg.c
@@ -382,14 +382,14 @@ int qpkg_main(int argc, char **argv)
(fd != -1 && (fstat(fd, &st) == -1 || !S_ISDIR(st.st_mode))))
{
errp("could not create temp bindir '%s'", qpkg_bindir);
- } else {
+ }
+ if (fd >= 0) {
/* fd is valid, pointing to a directory */
if (!restrict_chmod)
if (fchmod(fd, 0750) < 0)
errp("could not chmod(0750) temp bindir '%s'", qpkg_bindir);
- }
- 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. */