From f1d7ff42932e07786b8d761c2eeb141148d03aab Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 19 Apr 2010 10:39:50 +0000 Subject: [PATCH] fix --- src/util/os_priority.c | 4 ++-- src/util/test_os_priority.c | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/util/os_priority.c b/src/util/os_priority.c index e57d11d63..b0f2b3129 100644 --- a/src/util/os_priority.c +++ b/src/util/os_priority.c @@ -125,8 +125,8 @@ GNUNET_OS_set_process_priority (pid_t proc, have = nice (0); delta = rprio - have; errno = 0; - if ( (rprio != 0) && - (-1 == nice (delta)) && + if ( (delta != 0) && + (rprio == nice (delta)) && (errno != 0) ) { GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING | diff --git a/src/util/test_os_priority.c b/src/util/test_os_priority.c index 8284af5b8..ab0aba33d 100644 --- a/src/util/test_os_priority.c +++ b/src/util/test_os_priority.c @@ -35,6 +35,26 @@ testprio () GNUNET_OS_set_process_priority (getpid (), GNUNET_SCHEDULER_PRIORITY_DEFAULT)) return 1; + if (GNUNET_OK != + GNUNET_OS_set_process_priority (getpid (), + GNUNET_SCHEDULER_PRIORITY_UI)) + return 1; + if (GNUNET_OK != + GNUNET_OS_set_process_priority (getpid (), + GNUNET_SCHEDULER_PRIORITY_IDLE)) + return 1; + if (GNUNET_OK != + GNUNET_OS_set_process_priority (getpid (), + GNUNET_SCHEDULER_PRIORITY_BACKGROUND)) + return 1; + if (GNUNET_OK != + GNUNET_OS_set_process_priority (getpid (), + GNUNET_SCHEDULER_PRIORITY_HIGH)) + return 1; + if (GNUNET_OK != + GNUNET_OS_set_process_priority (getpid (), + GNUNET_SCHEDULER_PRIORITY_HIGH)) + return 1; #ifndef MINGW child = fork (); if (child == 0) -- 2.25.1