From 5ee314b6c1ffd8b090ca6771f0896e080f7000ef Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Thu, 19 Sep 2013 09:15:02 +0200 Subject: startup: bind the startup server to /servers/startup Previously, the Hurd (ab)used the fact that the startup server speaks all protocols on its message port. Any server that wished to register for shutdown notifications would use proc_getmsgport to get a port to the startup server. This hardcodes the PID of /hurd/startup, and does not allow one to point a server to ones own startup server (e.g. using remap). Bind the startup server to /servers/startup instead. Use this to contact the startup server. * exec/main.c (S_exec_init): Use /servers/startup. Fall back to the old method so that the system still boots when the node /servers/startup is missing. * hurd/paths.h (_SERVERS_STARTUP): New macro. * libdiskfs/boot-start.c (diskfs_S_fsys_init): Use /servers/startup. * libdiskfs/init-startup.c (_diskfs_init_completed): Likewise. * pfinet/main.c (arrange_shutdown_notification): Likewise. * startup/Makefile (OBJS): Add fsysServer.o. * startup/startup.c (demuxer): Handle the fsys protocol. (main): Bind to /servers/startup. (S_fsys_getroot): Implement fsys_getroot. Stub out the rest. --- pfinet/main.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'pfinet/main.c') diff --git a/pfinet/main.c b/pfinet/main.c index d52d9a3a..0f1fbfc7 100644 --- a/pfinet/main.c +++ b/pfinet/main.c @@ -24,11 +24,11 @@ #include #include #include +#include #include #include #include #include -#include /* Include Hurd's errno.h file, but don't include glue-include/linux/errno.h, since it #undef's the errno macro. */ @@ -154,7 +154,6 @@ arrange_shutdown_notification () { error_t err; mach_port_t initport, notify; - process_t procserver; struct port_info *pi; shutdown_notify_class = ports_create_class (0, 0); @@ -169,13 +168,8 @@ arrange_shutdown_notification () if (err) return; - procserver = getproc (); - if (!procserver) - return; - - err = proc_getmsgport (procserver, HURD_PID_STARTUP, &initport); - mach_port_deallocate (mach_task_self (), procserver); - if (err) + initport = file_name_lookup (_SERVERS_STARTUP, 0, 0); + if (initport == MACH_PORT_NULL) return; notify = ports_get_send_right (pi); -- cgit v1.2.3