From 394eebed6656dfc2e56a79500b602023000ac415 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Mon, 25 Feb 2008 20:30:24 +0000 Subject: lpd: spool mode added by Vladimir lpr: more robust error reporting *: introduce and use xchroot libbb: full_read/write now will report partial data counts prior to error isdirectory.c: style fixes lpd_main 249 486 +237 xchroot - 29 +29 get_response_or_say_and_die 110 139 +29 full_write 52 60 +8 full_read 55 63 +8 static.newline 1 - -1 switch_root_main 404 400 -4 chpst_main 1089 1079 -10 getopt32 1370 1359 -11 chroot_main 115 101 -14 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 4/4 up/down: 311/-40) Total: 271 bytes text data bss dec hex filename 798472 728 7484 806684 c4f1c busybox_old 798775 728 7484 806987 c504b busybox_unstripped --- util-linux/switch_root.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'util-linux') diff --git a/util-linux/switch_root.c b/util-linux/switch_root.c index bd1e9d5..3a17411 100644 --- a/util-linux/switch_root.c +++ b/util-linux/switch_root.c @@ -105,8 +105,9 @@ int switch_root_main(int argc, char **argv) // Overmount / with newdir and chroot into it. The chdir is needed to // recalculate "." and ".." links. - if (mount(".", "/", NULL, MS_MOVE, NULL) || chroot(".")) + if (mount(".", "/", NULL, MS_MOVE, NULL)) bb_error_msg_and_die("error moving root"); + xchroot("."); xchdir("/"); // If a new console specified, redirect stdin/stdout/stderr to that. -- cgit v1.1