summaryrefslogtreecommitdiff
path: root/libbb/xfuncs.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/xfuncs.c')
-rw-r--r--libbb/xfuncs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c
index 17760a3..18e696a 100644
--- a/libbb/xfuncs.c
+++ b/libbb/xfuncs.c
@@ -577,6 +577,12 @@ void xchdir(const char *path)
bb_perror_msg_and_die("chdir(%s)", path);
}
+void xchroot(const char *path)
+{
+ if (chroot(path))
+ bb_perror_msg_and_die("can't change root directory to %s", path);
+}
+
// Print a warning message if opendir() fails, but don't die.
DIR *warn_opendir(const char *path)
{