aboutsummaryrefslogtreecommitdiff
path: root/lib/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lib.c')
-rw-r--r--lib/lib.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/lib.c b/lib/lib.c
index 6102e1b4..0e3fe020 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -326,6 +326,11 @@ char *xabspath(char *path)
return path;
}
+void xchdir(char *path)
+{
+ if (chdir(path)) error_exit("chdir '%s'");
+}
+
// Ensure entire path exists.
// If mode != -1 set permissions on newly created dirs.
// Requires that path string be writable (for temporary null terminators).