summaryrefslogtreecommitdiff
path: root/node.c
diff options
context:
space:
mode:
authorSergiu Ivanov <unlimitedscolobb@gmail.com>2009-04-14 22:28:27 +0300
committerSergiu Ivanov <unlimitedscolobb@gmail.com>2009-04-14 22:28:27 +0300
commitdea12e2529ecdcab3a382fc71e7430326b74d6a6 (patch)
treeb6687c3868f668a25cf19ed1eb3159c5cd5af3ce /node.c
parentc9110f9c7d71fa9b157540a7aa2ade7f34b79968 (diff)
Made nsmux wait until dynamic translators finish
Previously, a settrans -gR on a node on which nsmux resides would only kill the dynamic translators, without shutting down nsmux, because it didn't wait for the children to close their ports, which made a check in netfs_shutdown fail. Now nsmux waits for the dynamic translator to finish, so settrans -gR does its job as expected: shuts down everything.
Diffstat (limited to 'node.c')
-rw-r--r--node.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/node.c b/node.c
index a7c85fd4c..b2cefb5f6 100644
--- a/node.c
+++ b/node.c
@@ -747,6 +747,9 @@ error_t
/*The control port for the active translator */
mach_port_t active_control;
+ /*The PID of the started translator */
+ pid_t trans_pid;
+
/*A copy of the user information, supplied in `user` */
struct iouser * user;
@@ -841,6 +844,9 @@ error_t
/*Drop our reference to the port */
ports_port_deref (newpi);
+ /*Store the task ID of the new translator */
+ trans_pid = task2pid(task);
+
/*
char buf[256];
char *_buf = buf;
@@ -914,7 +920,10 @@ error_t
return err;
/*Register the new translator*/
- err = trans_register (active_control, &np->nn->dyntrans);
+ err = trans_register (active_control, trans_pid, &np->nn->dyntrans);
+ LOG_MSG ("node_set_translator: Translator PID: %d", (int)trans_pid);
+ if (err)
+ return err;
/*Obtain the port to the top of the newly-set translator */
err = fsys_getroot