From 4bb80f906c27beb8a3d7e461d995ec2ec8d6bc87 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Thu, 15 Aug 2013 09:38:03 +0200 Subject: trans: register symlink translators as important Register any symlink translators running as root as important processes at the proc server. * trans/symlink.c (main): Mark us as important. --- trans/symlink.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/trans/symlink.c b/trans/symlink.c index 03b51003..845a1121 100644 --- a/trans/symlink.c +++ b/trans/symlink.c @@ -98,6 +98,19 @@ main (int argc, char **argv) io_restrict_auth (realnode, &realnodenoauth, 0, 0, 0, 0); mach_port_deallocate (mach_task_self (), realnode); + /* Mark us as important. */ + mach_port_t proc = getproc (); + if (proc == MACH_PORT_NULL) + error (2, 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 (2, err, "Cannot mark us as important"); + + mach_port_deallocate (mach_task_self (), proc); + /* Launch */ while (1) { -- cgit v1.2.3