From: Christian Grothoff Date: Mon, 19 Apr 2010 10:39:50 +0000 (+0000) Subject: fix X-Git-Tag: initial-import-from-subversion-38251~22100 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f1d7ff42932e07786b8d761c2eeb141148d03aab;p=oweals%2Fgnunet.git fix --- 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)