From c4199f22d0f7793b70db51c01783f0d45afce3d4 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 1 Apr 2016 22:12:44 +0200 Subject: libbb: two new functions: wait_for_exitstatus(pid), xfchdir(fd) Bartosz Golaszewski proposed xfchdir() Signed-off-by: Denys Vlasenko --- libbb/xfuncs_printf.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libbb/xfuncs_printf.c') diff --git a/libbb/xfuncs_printf.c b/libbb/xfuncs_printf.c index 73488908d..4aa1b5ce2 100644 --- a/libbb/xfuncs_printf.c +++ b/libbb/xfuncs_printf.c @@ -390,6 +390,12 @@ void FAST_FUNC xchdir(const char *path) bb_perror_msg_and_die("can't change directory to '%s'", path); } +void FAST_FUNC xfchdir(int fd) +{ + if (fchdir(fd)) + bb_perror_msg_and_die("fchdir"); +} + void FAST_FUNC xchroot(const char *path) { if (chroot(path)) -- cgit v1.2.3