[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [PATCH v7 7/7] runit: use xfchdir()
From:       Bartosz Golaszewski <bartekgola () gmail ! com>
Date:       2016-03-18 11:37:50
Message-ID: 1458301070-25452-8-git-send-email-bartekgola () gmail ! com
[Download RAW message or body]

Replace a call to fchdir() and the subsequent bail-out in case of an
error with a call to xfchdir().

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
---
 runit/chpst.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/runit/chpst.c b/runit/chpst.c
index 301cdd0..7fe5151 100644
--- a/runit/chpst.c
+++ b/runit/chpst.c
@@ -255,8 +255,7 @@ static NOINLINE void edir(const char *directory_name)
 		xsetenv(d->d_name, buf);
 	}
 	closedir(dir);
-	if (fchdir(wdir) == -1)
-		bb_perror_msg_and_die("fchdir");
+	xfchdir(wdir);
 	close(wdir);
 }
 
-- 
2.1.4

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic