summaryrefslogtreecommitdiff
path: root/utils/ldconfig.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-04-17 23:08:20 +0000
committerMike Frysinger <vapier@gentoo.org>2007-04-17 23:08:20 +0000
commit63f197200999f71193f5a57be8be0e289cd7dde1 (patch)
treefd497e05c3016df275ed8382e2f30d3219568eb5 /utils/ldconfig.c
parenta77c1608a45b4c8870d9e98b2ee44ed7228646ca (diff)
if chroot() failed, then reset "chroot_dir" to "." so that after we do our fallback chdir(), we dont continue to prefix the chroot path ... fixes `ldconfig.host -r some/dir/`
Diffstat (limited to 'utils/ldconfig.c')
-rw-r--r--utils/ldconfig.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/utils/ldconfig.c b/utils/ldconfig.c
index a5d3ce67c..0abd0613e 100644
--- a/utils/ldconfig.c
+++ b/utils/ldconfig.c
@@ -918,6 +918,7 @@ int main(int argc, char **argv)
if (chroot(chroot_dir) < 0) {
if (chdir(chroot_dir) < 0)
err(EXIT_FATAL, "couldn't chroot to %s (%s)", chroot_dir, strerror(errno));
+ chroot_dir = ".";
} else {
if (chdir("/") < 0)
err(EXIT_FATAL, "couldn't chdir to / (%s)", strerror(errno));