[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/17] libnetfs: register libnetfs-based translators as important
From: |
Justus Winter |
Subject: |
[PATCH 10/17] libnetfs: register libnetfs-based translators as important |
Date: |
Thu, 15 Aug 2013 09:38:00 +0200 |
Register libnetfs-based translators running as root as important
processes at the proc server.
* libnetfs/init-startup.c (netfs_startup): Mark us as important.
---
libnetfs/init-startup.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/libnetfs/init-startup.c b/libnetfs/init-startup.c
index 2e0f43a..e17c4f1 100644
--- a/libnetfs/init-startup.c
+++ b/libnetfs/init-startup.c
@@ -48,5 +48,19 @@ netfs_startup (mach_port_t bootstrap, int flags)
mach_port_deallocate (mach_task_self (), bootstrap);
+ /* Mark us as important. */
+ mach_port_t proc = getproc ();
+ if (proc == MACH_PORT_NULL)
+ error (12, err, "Translator startup failure: getproc");
+
+ err = proc_mark_important (proc);
+
+ /* This might fail due to permissions or because the old proc server
+ is still running, ignore any such errors. */
+ if (err && err != EPERM && err != EMIG_BAD_ID)
+ error (13, err, "Translator startup failure: proc_mark_important");
+
+ mach_port_deallocate (mach_task_self (), proc);
+
return realnode;
}
--
1.7.10.4
- [PATCH 05/17] proc: make the function check_owner available, (continued)
- [PATCH 06/17] proc: add proc_mark_important server code, Justus Winter, 2013/08/15
- [PATCH 07/17] hurd: add proc_mark_important, Justus Winter, 2013/08/15
- [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 <=
- [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, 2013/08/15