summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/init.c
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2004-08-12 11:35:33 +0000
committerOlivier Blin <oblin@mandriva.org>2004-08-12 11:35:33 +0000
commit4b8bcc895c61a7c39d1fdbf03b3537c569e01e73 (patch)
tree95f40c6c9fb86118006360c33f920f9a959ba9cf /mdk-stage1/init.c
parent406f9a546c77e4d52a27f96943715c003a4af2a9 (diff)
downloaddrakx-4b8bcc895c61a7c39d1fdbf03b3537c569e01e73.tar
drakx-4b8bcc895c61a7c39d1fdbf03b3537c569e01e73.tar.gz
drakx-4b8bcc895c61a7c39d1fdbf03b3537c569e01e73.tar.bz2
drakx-4b8bcc895c61a7c39d1fdbf03b3537c569e01e73.tar.xz
drakx-4b8bcc895c61a7c39d1fdbf03b3537c569e01e73.zip
use a do while loop to wait for forked process
Diffstat (limited to 'mdk-stage1/init.c')
-rw-r--r--mdk-stage1/init.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/mdk-stage1/init.c b/mdk-stage1/init.c
index 893bb9697..3a8d8e3b8 100644
--- a/mdk-stage1/init.c
+++ b/mdk-stage1/init.c
@@ -437,7 +437,6 @@ int main(int argc, char **argv)
int wait_status;
int fd;
int abnormal_termination = 0;
- int end_stage2 = 0;
if (argc > 1 && argv[1][0] >= '0' && argv[1][0] <= '9') {
printf("This is no normal init, sorry.\n"
@@ -516,11 +515,9 @@ int main(int argc, char **argv)
return 0;
}
- while (!end_stage2) {
+ do {
childpid = wait4(-1, &wait_status, 0, NULL);
- if (childpid == installpid)
- end_stage2 = 1;
- }
+ } while (childpid != installpid);
/* allow Ctrl Alt Del to reboot */
reboot(0xfee1dead, 672274793, BMAGIC_HARD);