diff options
-rw-r--r-- | libmachdev/trivfs_server.c | 27 | ||||
-rw-r--r-- | pci-arbiter/main.c | 13 | ||||
-rw-r--r-- | rumpdisk/main.c | 2 |
3 files changed, 18 insertions, 24 deletions
diff --git a/libmachdev/trivfs_server.c b/libmachdev/trivfs_server.c index e0b51529..bbd73555 100644 --- a/libmachdev/trivfs_server.c +++ b/libmachdev/trivfs_server.c @@ -557,27 +557,11 @@ trivfs_modify_stat (struct trivfs_protid *cred, io_statbuf_t *stat) { } -static void * -machdev_trivfs_loop(void *arg) -{ - struct trivfs_control *fsys = (struct trivfs_control *)arg; - - /* Launch. */ - do - { - ports_manage_port_operations_one_thread (port_bucket, demuxer, 0); - } while (trivfs_goaway (fsys, 0)); - - /* Never reached */ - return 0; -} - void machdev_trivfs_server(mach_port_t bootstrap) { struct trivfs_control *fsys = NULL; int err; - pthread_t t; if (bootstrapping == FALSE) { @@ -594,8 +578,11 @@ machdev_trivfs_server(mach_port_t bootstrap) fsys = control; } - err = pthread_create (&t, NULL, machdev_trivfs_loop, (void *)fsys); - if (err) - error (1, err, "Creating machdev server thread"); - pthread_detach (t); + /* Launch. */ + do + { + ports_manage_port_operations_one_thread (port_bucket, demuxer, 0); + } while (trivfs_goaway (fsys, 0)); + + /* Never reached */ } diff --git a/pci-arbiter/main.c b/pci-arbiter/main.c index 4f4f13da..b2c37f79 100644 --- a/pci-arbiter/main.c +++ b/pci-arbiter/main.c @@ -243,8 +243,17 @@ main (int argc, char **argv) error (1, err, "Starting the PCI system"); if (disk_server_task != MACH_PORT_NULL) - machdev_trivfs_server(bootstrap); - /* Timer started, quickly do all these next, before we call rump_init */ + { + void *run_server(void *arg) { + machdev_trivfs_server(bootstrap); + return NULL; + } + + pthread_t t; + pthread_create(&t, NULL, run_server, NULL); + pthread_detach(t); + /* Timer started, quickly do all these next, before we call rump_init */ + } if (disk_server_task == MACH_PORT_NULL) underlying_node = netfs_startup (bootstrap, O_READ); diff --git a/rumpdisk/main.c b/rumpdisk/main.c index 7f503b51..c5f44fb7 100644 --- a/rumpdisk/main.c +++ b/rumpdisk/main.c @@ -119,7 +119,5 @@ main (int argc, char **argv) return err; pthread_detach (t); machdev_trivfs_server (bootstrap); - /* Let the other threads do their job */ - pthread_exit (NULL); return 0; } |