[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 24/25: Avoid warnings if increasing a threads priority fails.
From: |
Samuel Thibault |
Subject: |
[hurd] 24/25: Avoid warnings if increasing a threads priority fails. |
Date: |
Mon, 24 Oct 2016 00:16:46 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 355577bc99c91363a1b7828e81086031ce75979b
Author: Justus Winter <address@hidden>
Date: Thu Oct 13 22:57:58 2016 +0200
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.
---
libports/manage-multithread.c | 5 +++++
proc/main.c | 7 ++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/libports/manage-multithread.c b/libports/manage-multithread.c
index 1588f63..576e767 100644
--- a/libports/manage-multithread.c
+++ b/libports/manage-multithread.c
@@ -68,6 +68,11 @@ adjust_priority (unsigned int totalthreads)
goto error_pset_priv;
err = thread_max_priority (self, pset_priv, 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 error_max_priority;
diff --git a/proc/main.c b/proc/main.c
index c4936f6..2c5ce55 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,
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 02/25: typo, (continued)
- [hurd] 02/25: typo, Samuel Thibault, 2016/10/23
- [hurd] 07/25: Fix looping over runsystem possibilities, Samuel Thibault, 2016/10/23
- [hurd] 03/25: Fix exec crash when setexecdata has never been called, Samuel Thibault, 2016/10/23
- [hurd] 05/25: exec: Fix loading binaries without a memory manager object, Samuel Thibault, 2016/10/23
- [hurd] 10/25: Fix patch to runsystem.hurd, Samuel Thibault, 2016/10/23
- [hurd] 20/25: console-client: Remove unused variable., Samuel Thibault, 2016/10/23
- [hurd] 19/25: ext2fs: Poison pointers into dereferenced cache pages., Samuel Thibault, 2016/10/23
- [hurd] 08/25: libfshelp: acquire references to control ports, Samuel Thibault, 2016/10/23
- [hurd] 15/25: Avoid fatal error handling in option parsers., Samuel Thibault, 2016/10/23
- [hurd] 25/25: boot: Ignore EINTR., Samuel Thibault, 2016/10/23
- [hurd] 24/25: Avoid warnings if increasing a threads priority fails.,
Samuel Thibault <=
- [hurd] 18/25: ext2fs: Rename parameter., Samuel Thibault, 2016/10/23
- [hurd] 09/25: Fix installing runsystem.hurd, Samuel Thibault, 2016/10/23
- [hurd] 12/25: fakeroot: set FAKED_MODE, Samuel Thibault, 2016/10/23
- [hurd] 14/25: ext2fs: Disable option to specify alternate superblock., Samuel Thibault, 2016/10/23
- [hurd] 17/25: trans/crash: Fix setting core file template at runtime., Samuel Thibault, 2016/10/23
- [hurd] 21/25: fshelp: Fix fetching the control port., Samuel Thibault, 2016/10/23
- [hurd] 06/25: startup: Fix looping over runsystem, Samuel Thibault, 2016/10/23
- [hurd] 16/25: trans/crash: Use empty core file templates to disable the feature., Samuel Thibault, 2016/10/23
- [hurd] 13/25: libdiskfs: Fix short-circuiting translators., Samuel Thibault, 2016/10/23
- [hurd] 11/25: random: Hash continuous areas in the csprng pool., Samuel Thibault, 2016/10/23