stuff
[oweals/gnunet.git] / src / util / os_priority.c
index b0f2b31294ea187d90a5b059f313f0fd4f36c9e1..77b2627035f06426cb559842445084865d2fe52b 100644 (file)
@@ -62,8 +62,6 @@ GNUNET_OS_set_process_priority (pid_t proc,
                                 enum GNUNET_SCHEDULER_Priority prio)
 {
   int rprio = 0;
-  int have;
-  int delta;
 
   GNUNET_assert (prio < GNUNET_SCHEDULER_PRIORITY_COUNT);
   if (prio == GNUNET_SCHEDULER_PRIORITY_KEEP)
@@ -118,12 +116,12 @@ GNUNET_OS_set_process_priority (pid_t proc,
   /* Set process priority */
 #ifdef MINGW
   SetPriorityClass (GetCurrentProcess (), rprio);
-#else
+#elif LINUX 
   if ( (0 == proc) ||
        (proc == getpid () ) )
     {
-      have = nice (0);
-      delta = rprio - have;
+      int have = nice (0);
+      int delta = rprio - have;
       errno = 0;
       if ( (delta != 0) &&
           (rprio == nice (delta)) && 
@@ -144,6 +142,9 @@ GNUNET_OS_set_process_priority (pid_t proc,
           return GNUNET_SYSERR;
         }
     }
+#else
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
+             "Priority management not availabe for this platform\n");
 #endif
   return GNUNET_OK;
 }