summaryrefslogtreecommitdiff
path: root/src/init
diff options
context:
space:
mode:
Diffstat (limited to 'src/init')
-rw-r--r--src/init/fs/misc.c5
-rw-r--r--src/init/tar.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/init/fs/misc.c b/src/init/fs/misc.c
index d12fce3..cb94ef5 100644
--- a/src/init/fs/misc.c
+++ b/src/init/fs/misc.c
@@ -17,8 +17,8 @@ void fs_passthru(const char *prefix) {
int ret, prefix_len;
if (prefix) prefix_len = strlen(prefix);
- for (;;) {
- switch (_syscall_fs_wait(buf, buf_size, &res)) {
+ while (!_syscall_fs_wait(buf, buf_size, &res)) {
+ switch (res.op) {
case VFSOP_OPEN:
if (prefix) {
if (prefix_len + res.len <= buf_size) {
@@ -50,4 +50,5 @@ void fs_passthru(const char *prefix) {
break;
}
}
+ _syscall_exit(0);
}
diff --git a/src/init/tar.c b/src/init/tar.c
index b041a98..e0843e7 100644
--- a/src/init/tar.c
+++ b/src/init/tar.c
@@ -18,8 +18,8 @@ static const char *root_fakemeta = ""; /* see comment in tar_open */
void tar_driver(void *base) {
static char buf[BUF_SIZE];
struct fs_wait_response res;
- for (;;) {
- switch (_syscall_fs_wait(buf, BUF_SIZE, &res)) {
+ while (!_syscall_fs_wait(buf, BUF_SIZE, &res)) {
+ switch (res.op) {
case VFSOP_OPEN:
_syscall_fs_respond(NULL, tar_open(buf, res.len, base, ~0));
break;
@@ -33,6 +33,7 @@ void tar_driver(void *base) {
break;
}
}
+ _syscall_exit(0);
}
static int tar_open(const char *path, int len, void *base, size_t base_len) {