summaryrefslogtreecommitdiff
path: root/pfinet/main.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1999-06-13 23:43:03 +0000
committerRoland McGrath <roland@gnu.org>1999-06-13 23:43:03 +0000
commit084a4d309ffcc649d271097932686dcca19d1a5a (patch)
tree8f2e0aab9ea89181238018174b9e318568405bec /pfinet/main.c
parent3e10208dd0038f784d6eb7fea50f2575979d0725 (diff)
1999-06-13 Roland McGrath <roland@baalperazim.frob.com>
* main.c (trivfs_goaway): Exit if there are no socket ports.
Diffstat (limited to 'pfinet/main.c')
-rw-r--r--pfinet/main.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/pfinet/main.c b/pfinet/main.c
index 41b34005..a0e149b3 100644
--- a/pfinet/main.c
+++ b/pfinet/main.c
@@ -228,5 +228,27 @@ trivfs_goaway (struct trivfs_control *cntl, int flags)
if (flags & FSYS_GOAWAY_FORCE)
exit (0);
else
- return EBUSY;
+ {
+ /* Stop new requests. */
+ ports_inhibit_class_rpcs (trivfs_cntl_portclasses[0]);
+ ports_inhibit_class_rpcs (trivfs_protid_portclasses[0]);
+ ports_inhibit_class_rpcs (socketport_class);
+
+ if (ports_count_class (socketport_class) != 0)
+ {
+ /* We won't go away, so start things going again... */
+ ports_enable_class (socketport_class);
+ ports_resume_class_rpcs (trivfs_cntl_portclasses[0]);
+ ports_resume_class_rpcs (trivfs_protid_portclasses[0]);
+
+ return EBUSY;
+ }
+
+ /* There are no sockets, so we can die without breaking anybody
+ too badly. We don't let user ports on the /servers/socket/2
+ file keep us alive because those get cached in every process
+ that ever makes a PF_INET socket, libc copes with getting
+ MACH_SEND_INVALID_DEST and looking up the new translator. */
+ exit (0);
+ }
}