summaryrefslogtreecommitdiff
path: root/src/init/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/init/main.c')
-rw-r--r--src/init/main.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/init/main.c b/src/init/main.c
index 558fb77..8e78b87 100644
--- a/src/init/main.c
+++ b/src/init/main.c
@@ -80,16 +80,17 @@ void fs_test(void) {
void test_await(void) {
char buf[16];
int len;
+
// the child immediately dies
if (!_syscall_fork())
_syscall_exit(argify("i'm dead"));
+ if (!_syscall_fork())
+ _syscall_exit(argify("i'm also dead"));
- len = _syscall_await(buf, 16);
- if (len < 0) {
- log("await: negative len\n");
- } else {
+ while ((len = _syscall_await(buf, 16)) >= 0) {
log("await returned: ");
_syscall_write(tty_fd, buf, len, 0);
log("\n");
}
+ log("await: negative len\n");
}