summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaksym Planeta <mcsim.planeta@gmail.com>2012-01-07 19:16:35 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2012-04-02 00:23:02 +0200
commit2ad066887faafa32ec7b30c31a8d0f11f030f7bb (patch)
tree118c19d591454e5c075fb51bb95163768e2b3690
parentbf1a2c7dd16ff547fdf00c5730f7476fa8e7bca0 (diff)
Prevent auto-terminating of tmpfs due to idle.
* tmpfs/tmpfs.c (diskfs_thread_function): New function. (main): Manually detach diskfs demuxer.
-rw-r--r--tmpfs/tmpfs.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/tmpfs/tmpfs.c b/tmpfs/tmpfs.c
index cd67dd74..b72459fe 100644
--- a/tmpfs/tmpfs.c
+++ b/tmpfs/tmpfs.c
@@ -255,6 +255,30 @@ diskfs_append_args (char **argz, size_t *argz_len)
return err;
}
+/* Handling of operations for the ports in diskfs_port_bucket, calling
+ * demuxer for each incoming message */
+static any_t
+diskfs_thread_function (any_t demuxer)
+{
+ error_t err;
+
+ do
+ {
+ ports_manage_port_operations_multithread (diskfs_port_bucket,
+ (ports_demuxer_type) demuxer,
+ 0,
+ 0,
+ 0);
+ err = diskfs_shutdown (0);
+ }
+ while (err);
+
+ exit (0);
+ /* NOTREACHED */
+ return (any_t) 0;
+}
+
+
/* Add our startup arguments to the standard diskfs set. */
static const struct argp_child startup_children[] =
{{&diskfs_startup_argp}, {0}};
@@ -317,7 +341,9 @@ main (int argc, char **argv)
if (err)
error (4, err, "cannot create root directory");
- diskfs_spawn_first_thread (diskfs_demuxer);
+ /* Like diskfs_spawn_first_thread. But do it manually, without timeout */
+ cthread_detach (cthread_fork ((cthread_fn_t) diskfs_thread_function,
+ (any_t) diskfs_demuxer));
/* Now that we are all set up to handle requests, and diskfs_root_node is
set properly, it is safe to export our fsys control port to the