summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2013-08-04 13:45:16 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2013-08-04 13:45:34 +0200
commit5b6534d7c9cdd0d6f0284cdf6f30b9bcf5fffc52 (patch)
tree08194a75bc15e6cd1ad134de85c4db1de78eccbc
parent215ee22f3c0d6c45403e562fee95d809547b4302 (diff)
Fix fsys_goaway
-rw-r--r--Makefile2
-rw-r--r--fsys_proxy.c15
-rw-r--r--fsys_request.defs37
-rw-r--r--persistent-hello.c3
-rw-r--r--reincarnation.c6
-rw-r--r--reincarnation.defs3
6 files changed, 63 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 76cdbc0..17578a1 100644
--- a/Makefile
+++ b/Makefile
@@ -29,6 +29,7 @@ OBJS = $(SRCS:.c=.o) \
reincarnationUser.o \
fsysServer.o \
fsys_proxy.o \
+ fsys_requestUser.o \
targets = reincarnation persistent-hello
HURDLIBS = fshelp trivfs ihash shouldbeinlibc
@@ -37,6 +38,7 @@ include ../Makeconf
reincarnation: stubs.o notifyServer.o reincarnationServer.o \
fsysServer.o fsys_proxy.o \
+ fsys_requestUser.o \
../libfshelp/libfshelp.a
persistent-hello: reincarnationUser.o ../libtrivfs/libtrivfs.a ../libfshelp/libfshelp.a ../libports/libports.a ../libihash/libihash.a
diff --git a/fsys_proxy.c b/fsys_proxy.c
index 0af04ac..fd528c3 100644
--- a/fsys_proxy.c
+++ b/fsys_proxy.c
@@ -19,9 +19,13 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#include <hurd/fsys.h>
+
#include "priv.h"
-#include <hurd/fsys.h>
+/* Hack to get to the new declaration. */
+#undef _fsys_user_
+#include "fsys_request_U.h"
error_t
S_fsys_startup (mach_port_t bootstrap, int flags, mach_port_t control,
@@ -94,8 +98,13 @@ S_fsys_getroot (mach_port_t fsys_t,
error_t
S_fsys_goaway (mach_port_t control, int flags)
{
- /* XXX we never get to see those... */
- return EOPNOTSUPP;
+ /* Tell our child to go away. */
+ fsys_goaway_request (active_control,
+ /* We won't be around for the reply anyway. */
+ mach_reply_port (),
+ flags);
+
+ exit (0);
}
error_t
diff --git a/fsys_request.defs b/fsys_request.defs
new file mode 100644
index 0000000..fb6a26a
--- /dev/null
+++ b/fsys_request.defs
@@ -0,0 +1,37 @@
+/* Definitions for the filesystem control interface
+ Copyright (C) 1992,93,94,95,96,97, 2002 Free Software Foundation
+
+This file is part of the GNU Hurd.
+
+The GNU Hurd is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU Hurd is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU Hurd; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+subsystem fsys 22000;
+
+#include <hurd/hurd_types.defs>
+
+#ifdef FSYS_IMPORTS
+FSYS_IMPORTS
+#endif
+
+type reply_port_t = MACH_MSG_TYPE_MAKE_SEND_ONCE | polymorphic
+ ctype: mach_port_t;
+
+skip; /* fsys_startup */
+
+/* Filesystem should go away. Bye. */
+simpleroutine fsys_goaway_request (
+ fsys: fsys_t;
+ ureplyport reply: reply_port_t;
+ flags: int);
diff --git a/persistent-hello.c b/persistent-hello.c
index 85f0335..5cceb8a 100644
--- a/persistent-hello.c
+++ b/persistent-hello.c
@@ -92,6 +92,9 @@ trivfs_modify_stat (struct trivfs_protid *cred, struct stat *st)
error_t
trivfs_goaway (struct trivfs_control *cntl, int flags)
{
+ if (reincarnation != MACH_PORT_NULL)
+ reincarnation_goaway (reincarnation);
+
exit (0);
}
diff --git a/reincarnation.c b/reincarnation.c
index ed188fc..bddac0c 100644
--- a/reincarnation.c
+++ b/reincarnation.c
@@ -467,3 +467,9 @@ S_reincarnation_checkpoint (mach_port_t server,
stored_image_len = imageCnt;
return 0;
}
+
+error_t
+S_reincarnation_goaway (mach_port_t server)
+{
+ exit (0);
+}
diff --git a/reincarnation.defs b/reincarnation.defs
index edcd053..204a466 100644
--- a/reincarnation.defs
+++ b/reincarnation.defs
@@ -34,3 +34,6 @@ routine reincarnation_reincarnate (
routine reincarnation_checkpoint (
server: mach_port_t;
in image: data_t);
+
+routine reincarnation_goaway (
+ server: mach_port_t);