From 355577bc99c91363a1b7828e81086031ce75979b Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Thu, 13 Oct 2016 22:57:58 +0200 Subject: Avoid warnings if increasing a threads priority fails. * libports/manage-multithread.c (adjust_priorities): Avoid displaying error messages if we do not have the privileged processor set port by treating this error condition like EPERM. * proc/main.c (increase_priority, main): Likewise. --- proc/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'proc/main.c') diff --git a/proc/main.c b/proc/main.c index c4936f68..2c5ce553 100644 --- a/proc/main.c +++ b/proc/main.c @@ -80,6 +80,11 @@ increase_priority (void) goto out; err = thread_max_priority (mach_thread_self (), psetcntl, 0); + /* If we are running in an unprivileged subhurd, we got a faked + privileged processor set port. This is indeed a kind of + permission problem, and we treat it as such. */ + if (err == KERN_INVALID_ARGUMENT) + err = EPERM; if (err) goto out; @@ -155,7 +160,7 @@ main (int argc, char **argv, char **envp) /* Give ourselves good scheduling performance, because we are so important. */ err = increase_priority (); - if (err) + if (err && err != EPERM) error (0, err, "Increasing priority failed"); err = register_new_task_notification (_hurd_host_priv, -- cgit v1.2.3