From 2f287003e0bc9a74e1bb7b0399aa9f28f31b7718 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 18 Feb 2009 03:14:27 +0100 Subject: [PATCH] xbps_install_binary_pkg: chdir to / if destdir not set. Fixes installation of binpkgs in the chroot. --HG-- extra : convert_revision : fb68c94d81b1803fe77fb025929ffd727b04cbbb --- lib/install.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/install.c b/lib/install.c index bb16117877..4550e09d64 100644 --- a/lib/install.c +++ b/lib/install.c @@ -90,8 +90,11 @@ xbps_install_binary_pkg(const char *pkgname, const char *destdir, int flags) if (destdir) { if ((rv = chdir(destdir)) != 0) return errno; - } else + } else { + if ((rv = chdir("/")) != 0) + return errno; destdir = "NOTSET"; + } cb.pkgname = pkgname; cb.destdir = destdir;