summaryrefslogtreecommitdiff
path: root/mach-defpager
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2013-08-15 09:38:02 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-08-29 01:53:38 +0200
commited1863a6e6a762c7620f921c0290b33379b3b54d (patch)
tree130aad1261a25f4a3f6e0138a8ba0da5fceeb897 /mach-defpager
parente3c51fc088975f5b74e68a314e8fdfc907ad9640 (diff)
mach-defpager: register mach-defpager translators as important
Register any mach-defpager translators running as root as important processes at the proc server. * mach-defpager/main.c (main): Mark us as important.
Diffstat (limited to 'mach-defpager')
-rw-r--r--mach-defpager/main.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/mach-defpager/main.c b/mach-defpager/main.c
index 3134d6f3..fe6f735f 100644
--- a/mach-defpager/main.c
+++ b/mach-defpager/main.c
@@ -125,6 +125,19 @@ main (int argc, char **argv)
}
}
+ /* Mark us as important. */
+ mach_port_t proc = getproc ();
+ if (proc == MACH_PORT_NULL)
+ error (3, err, "cannot get a handle to our process");
+
+ 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 (3, err, "cannot mark us as important");
+
+ mach_port_deallocate (mach_task_self (), proc);
+
printf_init(bootstrap_master_device_port);
/*