xbps_install_binary_pkg: chdir to / if destdir not set.

Fixes installation of binpkgs in the chroot.

--HG--
extra : convert_revision : fb68c94d81b1803fe77fb025929ffd727b04cbbb
This commit is contained in:
Juan RP 2009-02-18 03:14:27 +01:00
parent 59a2ac4118
commit 2f287003e0

View file

@ -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;