diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2013-08-15 09:38:03 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2013-08-29 01:53:47 +0200 |
commit | 4bb80f906c27beb8a3d7e461d995ec2ec8d6bc87 (patch) | |
tree | 5fdeb7192a11c4f0611bc94f8f884fff3489009c | |
parent | ed1863a6e6a762c7620f921c0290b33379b3b54d (diff) |
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.
-rw-r--r-- | trans/symlink.c | 13 |
1 files changed, 13 insertions, 0 deletions
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) { |