[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/2] Hurd: make reboot() send messages to both pid 1 and 2
From: |
Justus Winter |
Subject: |
[PATCH 1/2] Hurd: make reboot() send messages to both pid 1 and 2 |
Date: |
Thu, 15 Aug 2013 10:43:34 +0200 |
Previously /hurd/init was run as pid 1 on Hurd systems, however
sysvinit assumes that it is being run as pid 1. To appease sysvinit,
/hurd/init will be run as pid 2 in the near future.
Currently the pid of /hurd/init is hardcoded to 1. This patch makes
reboot() try to send the start_reboot message to pid 1, and if that
fails it will send it to pid 2.
* sysdeps/mach/hurd/reboot.c (reboot): Try to send a startup_reboot
message to both pid 1 and 2.
---
ChangeLog | 5 +++++
sysdeps/mach/hurd/reboot.c | 13 +++++++++----
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index fa588c9..0274da9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-08 Justus Winter <4winter@informatik.uni-hamburg.de>
+
+ * sysdeps/mach/hurd/reboot.c (reboot): Try to send a
+ startup_reboot message to both pid 1 and 2.
+
2013-08-03 David S. Miller <davem@davemloft.net>
* po/ko.po: Update Korean translation from translation project.
diff --git a/sysdeps/mach/hurd/reboot.c b/sysdeps/mach/hurd/reboot.c
index 60d96ea..e23215a 100644
--- a/sysdeps/mach/hurd/reboot.c
+++ b/sysdeps/mach/hurd/reboot.c
@@ -33,11 +33,16 @@ reboot (int howto)
if (err)
return __hurd_fail (EPERM);
- err = __USEPORT (PROC, __proc_getmsgport (port, 1, &init));
- if (!err)
+ for (pid_t pid = 1; pid < 3; pid++)
{
- err = __startup_reboot (init, hostpriv, howto);
- __mach_port_deallocate (__mach_task_self (), init);
+ err = __USEPORT (PROC, __proc_getmsgport (port, pid, &init));
+ if (!err)
+ {
+ err = __startup_reboot (init, hostpriv, howto);
+ __mach_port_deallocate (__mach_task_self (), init);
+ if (!err)
+ break;
+ }
}
__mach_port_deallocate (__mach_task_self (), hostpriv);
--
1.7.10.4
- [PATCH 08/17] init: Mark all of inits children and init itself as important, (continued)
- [PATCH 08/17] init: Mark all of inits children and init itself as important, Justus Winter, 2013/08/15
- [PATCH 09/17] libdiskfs: register libdiskfs-based translators as important, Justus Winter, 2013/08/15
- [PATCH 11/17] libtrivfs: register libtrivfs-based translators as important, Justus Winter, 2013/08/15
- [PATCH 10/17] libnetfs: register libnetfs-based translators as important, Justus Winter, 2013/08/15
- [PATCH 12/17] mach-defpager: register mach-defpager translators as important, Justus Winter, 2013/08/15
- [PATCH 13/17] trans: register symlink translators as important, Justus Winter, 2013/08/15
- [PATCH 15/17] hurd: add proc_{get,set}_code, Justus Winter, 2013/08/15
- [PATCH 16/17] exec: keep track of the range where executable segments are mapped, Justus Winter, 2013/08/15
- [PATCH 14/17] proc: keep track of {start,end}_code, Justus Winter, 2013/08/15
- [PATCH 17/17] Build fixes: Build processUser.o and link against it, Justus Winter, 2013/08/15
- [PATCH 1/2] Hurd: make reboot() send messages to both pid 1 and 2,
Justus Winter <=