summaryrefslogtreecommitdiff
path: root/util-linux/switch_root.c
diff options
context:
space:
mode:
authorDenis Vlasenko2006-11-01 10:25:35 +0000
committerDenis Vlasenko2006-11-01 10:25:35 +0000
commit92258541449581302e180d05e827e27d35030a18 (patch)
tree99c5ad443f69860833c8ef37e142fddfedb90872 /util-linux/switch_root.c
parent048c93cc5593d53d6243c3e15dc8a5b0072a6083 (diff)
downloadbusybox-92258541449581302e180d05e827e27d35030a18.zip
busybox-92258541449581302e180d05e827e27d35030a18.tar.gz
mostly style fixes
Diffstat (limited to 'util-linux/switch_root.c')
-rw-r--r--util-linux/switch_root.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/util-linux/switch_root.c b/util-linux/switch_root.c
index 45290c9..4c23f69 100644
--- a/util-linux/switch_root.c
+++ b/util-linux/switch_root.c
@@ -35,7 +35,7 @@ static void delete_contents(char *directory)
struct stat st;
// Don't descend into other filesystems
- if (lstat(directory,&st) || st.st_dev != rootdev) return;
+ if (lstat(directory, &st) || st.st_dev != rootdev) return;
// Recursively delete the contents of directories.
if (S_ISDIR(st.st_mode)) {
@@ -71,8 +71,8 @@ int switch_root_main(int argc, char *argv[])
// Parse args (-c console)
- opt_complementary="-2";
- getopt32(argc,argv,"c:",&console);
+ opt_complementary = "-2";
+ getopt32(argc, argv, "c:", &console);
// Change to new root directory and verify it's a different fs.
@@ -81,7 +81,7 @@ int switch_root_main(int argc, char *argv[])
if (chdir(newroot) || lstat(".", &st1) || lstat("/", &st2) ||
st1.st_dev == st2.st_dev)
{
- bb_error_msg_and_die("bad newroot %s",newroot);
+ bb_error_msg_and_die("bad newroot %s", newroot);
}
rootdev=st2.st_dev;
@@ -111,12 +111,12 @@ int switch_root_main(int argc, char *argv[])
if (console) {
close(0);
if(open(console, O_RDWR) < 0)
- bb_error_msg_and_die("bad console '%s'",console);
+ bb_error_msg_and_die("bad console '%s'", console);
dup2(0, 1);
dup2(0, 2);
}
// Exec real init. (This is why we must be pid 1.)
- execv(argv[optind],argv+optind);
- bb_error_msg_and_die("bad init '%s'",argv[optind]);
+ execv(argv[optind], argv+optind);
+ bb_error_msg_and_die("bad init '%s'", argv[optind]);
}