[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] hurd: Get a startup server port from a file instead of a PID

From: David Michael
Subject: [PATCH] hurd: Get a startup server port from a file instead of a PID
Date: Sun, 01 Feb 2015 15:33:37 -0500

To allow easier implementation of different init systems, Hurd no
longer requires PID 1 to speak the startup protocol.  Ports to the
startup server are now obtained from /servers/startup instead.


This patch has been included in Hurd's glibc branch and Debian's libc
for a while, and we'd like to have it applied upstream.

I haven't submitted copyright assignment papers for glibc, but I don't
believe this change is legally significant.  Let me know if I need to
take care of copyright assignment for this.



 ChangeLog                  | 6 ++++++
 sysdeps/mach/hurd/reboot.c | 5 +++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 50e8153..9b0b580 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-02-01  David Michael  <fedora.dm0@gmail.com>
+       * sysdeps/mach/hurd/reboot.c: Include <hurd/paths.h>.
+       (reboot): Look up the file _SERVERS_STARTUP instead of PID 1 to get a
+       port to the startup server.
 2015-01-31  David S. Miller  <davem@davemloft.net>
        * sysdeps/sparc/sparc32/bits/atomic.h
diff --git a/sysdeps/mach/hurd/reboot.c b/sysdeps/mach/hurd/reboot.c
index 654745b..cb59a2b 100644
--- a/sysdeps/mach/hurd/reboot.c
+++ b/sysdeps/mach/hurd/reboot.c
@@ -18,6 +18,7 @@
 #include <errno.h>
 #include <unistd.h>
 #include <hurd.h>
+#include <hurd/paths.h>
 #include <hurd/startup.h>
 #include <sys/reboot.h>
@@ -33,8 +34,8 @@ reboot (int howto)
   if (err)
     return __hurd_fail (EPERM);
-  err = __USEPORT (PROC, __proc_getmsgport (port, 1, &init));
-  if (!err)
+  init = __file_name_lookup (_SERVERS_STARTUP, 0, 0);
+  if (init != MACH_PORT_NULL)
       err = __startup_reboot (init, hostpriv, howto);
       __mach_port_deallocate (__mach_task_self (), init);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]