summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install/add/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/pkg_install/add/main.c')
-rw-r--r--usr.sbin/pkg_install/add/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/pkg_install/add/main.c b/usr.sbin/pkg_install/add/main.c
index 39c1247..5932e1a 100644
--- a/usr.sbin/pkg_install/add/main.c
+++ b/usr.sbin/pkg_install/add/main.c
@@ -288,7 +288,9 @@ main(int argc, char **argv)
}
/* Perform chroot if requested */
if (Chroot != NULL) {
- if (chroot(Chroot))
+ if (chdir(Chroot))
+ errx(1, "chdir to %s failed", Chroot);
+ if (chroot("."))
errx(1, "chroot to %s failed", Chroot);
}
/* Make sure the sub-execs we invoke get found */
OpenPOWER on IntegriCloud