Skip to content

Commit 587aa1f

Browse files
committed
Fix whitespaces in init/init.c, no functional changes.
Preparation for a couple of fixes/improvements, these are only re-indents and some tabs vs spaces so that the next commit intention is clear.
1 parent 727153a commit 587aa1f

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

init/init.c

+26-26
Original file line numberDiff line numberDiff line change
@@ -69,38 +69,38 @@ int main(int argc, char **argv)
6969
if (passp) {
7070
printf("Unlocking LUKS root filesystem\n");
7171

72-
if (mount("proc", "/proc", "proc",
73-
MS_NODEV | MS_NOEXEC | MS_NOSUID | MS_RELATIME, NULL) < 0) {
74-
perror("mount(/proc)");
75-
exit(-1);
76-
}
72+
if (mount("proc", "/proc", "proc",
73+
MS_NODEV | MS_NOEXEC | MS_NOSUID | MS_RELATIME, NULL) < 0) {
74+
perror("mount(/proc)");
75+
exit(-1);
76+
}
7777

78-
pipe(pipefd);
78+
pipe(pipefd);
7979

80-
pid = fork();
81-
if (pid == 0) {
80+
pid = fork();
81+
if (pid == 0) {
8282
close(pipefd[1]);
83-
dup2(pipefd[0], 0);
84-
close(pipefd[0]);
83+
dup2(pipefd[0], 0);
84+
close(pipefd[0]);
8585

86-
if (execl("/sbin/cryptsetup", "cryptsetup", "open", "/dev/vda", "luksroot", "-", NULL) < 0) {
86+
if (execl("/sbin/cryptsetup", "cryptsetup", "open", "/dev/vda", "luksroot", "-", NULL) < 0) {
8787
perror("execl");
8888
exit(-1);
8989
}
90-
} else {
91-
write(pipefd[1], passp, strnlen(passp, 128));
92-
close(pipefd[1]);
93-
waitpid(pid, &wstatus, 0);
94-
}
90+
} else {
91+
write(pipefd[1], passp, strnlen(passp, 128));
92+
close(pipefd[1]);
93+
waitpid(pid, &wstatus, 0);
94+
}
9595

9696
printf("Mounting LUKS root filesystem\n");
9797

98-
if (mount("/dev/mapper/luksroot", "/luksroot", "ext4", 0, NULL) < 0) {
99-
perror("mount(/luksroot)");
100-
exit(-1);
101-
}
98+
if (mount("/dev/mapper/luksroot", "/luksroot", "ext4", 0, NULL) < 0) {
99+
perror("mount(/luksroot)");
100+
exit(-1);
101+
}
102102

103-
chdir("/luksroot");
103+
chdir("/luksroot");
104104

105105
if (mount(".", "/", NULL, MS_MOVE, NULL)) {
106106
perror("remount root");
@@ -110,19 +110,19 @@ int main(int argc, char **argv)
110110
}
111111

112112
if (mount("proc", "/proc", "proc",
113-
MS_NODEV | MS_NOEXEC | MS_NOSUID | MS_RELATIME, NULL) < 0) {
113+
MS_NODEV | MS_NOEXEC | MS_NOSUID | MS_RELATIME, NULL) < 0) {
114114
perror("mount(/proc)");
115115
exit(-1);
116116
}
117117

118118
if (mount("sysfs", "/sys", "sysfs",
119-
MS_NODEV | MS_NOEXEC | MS_NOSUID | MS_RELATIME, NULL) < 0) {
119+
MS_NODEV | MS_NOEXEC | MS_NOSUID | MS_RELATIME, NULL) < 0) {
120120
perror("mount(/sys)");
121121
exit(-1);
122122
}
123123

124124
if (mount("cgroup2", "/sys/fs/cgroup", "cgroup2",
125-
MS_NODEV | MS_NOEXEC | MS_NOSUID | MS_RELATIME, NULL) < 0) {
125+
MS_NODEV | MS_NOEXEC | MS_NOSUID | MS_RELATIME, NULL) < 0) {
126126
perror("mount(/sys/fs/cgroup)");
127127
exit(-1);
128128
}
@@ -133,7 +133,7 @@ int main(int argc, char **argv)
133133
}
134134

135135
if (mount("devpts", "/dev/pts", "devpts",
136-
MS_NOEXEC | MS_NOSUID | MS_RELATIME, NULL) < 0) {
136+
MS_NOEXEC | MS_NOSUID | MS_RELATIME, NULL) < 0) {
137137
perror("mount(/dev/pts)");
138138
exit(-1);
139139
}
@@ -144,7 +144,7 @@ int main(int argc, char **argv)
144144
}
145145

146146
if (mount("tmpfs", "/dev/shm", "tmpfs",
147-
MS_NOEXEC | MS_NOSUID | MS_RELATIME, NULL) < 0) {
147+
MS_NOEXEC | MS_NOSUID | MS_RELATIME, NULL) < 0) {
148148
perror("mount(/dev/shm)");
149149
exit(-1);
150150
}

0 commit comments

Comments
 (0)