From: Christian Grothoff Date: Mon, 24 Jan 2011 12:24:11 +0000 (+0000) Subject: just use setpriority X-Git-Tag: initial-import-from-subversion-38251~19277 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a5769eb8918ccb0a7baac179569e7a713ad08465;p=oweals%2Fgnunet.git just use setpriority --- diff --git a/src/util/os_priority.c b/src/util/os_priority.c index e9ca9deea..3993f572c 100644 --- a/src/util/os_priority.c +++ b/src/util/os_priority.c @@ -320,32 +320,11 @@ GNUNET_OS_set_process_priority (struct GNUNET_OS_Process *proc, SetPriorityClass (h, rprio); } #elif LINUX - pid_t pid; - - pid = proc->pid; - if ( (0 == pid) || - (pid == getpid () ) ) - { - int have = nice (0); - int delta = rprio - have; - errno = 0; - if ( (delta != 0) && - (rprio == nice (delta)) && - (errno != 0) ) - { - GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING | - GNUNET_ERROR_TYPE_BULK, "nice"); - return GNUNET_SYSERR; - } - } - else + if (0 != setpriority (PRIO_PROCESS, proc->pid, rprio)) { - if (0 != setpriority (PRIO_PROCESS, pid, rprio)) - { - GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING | - GNUNET_ERROR_TYPE_BULK, "setpriority"); - return GNUNET_SYSERR; - } + GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING | + GNUNET_ERROR_TYPE_BULK, "setpriority"); + return GNUNET_SYSERR; } #else GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,