diff options
author | Fabian Groffen <grobian@gentoo.org> | 2020-06-27 10:59:02 +0200 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2020-06-27 10:59:02 +0200 |
commit | 958909e44147a89d77fb1e416f20aaa51148a550 (patch) | |
tree | 3bd16992eddf9af8fc54fb1b556b6a463daac7e2 | |
parent | libq/tree: fix metadata cache after realloc (diff) | |
download | portage-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.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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. */ |