]> code.delx.au - pulseaudio/commitdiff
Core: Fix incorrect check of return value
authorScott Reeves <sreeves@novell.com>
Thu, 20 Jan 2011 23:41:21 +0000 (16:41 -0700)
committerColin Guthrie <cguthrie@mandriva.org>
Sun, 23 Jan 2011 14:10:49 +0000 (14:10 +0000)
src/pulsecore/core-util.c

index effc598eb5e2344042dc0de3b181329545437006..4e7d0d71c76a5763064b0ee9b2223fb4d735bf58 100644 (file)
@@ -680,7 +680,7 @@ int pa_make_realtime(int rtprio) {
     }
 
     for (p = rtprio-1; p >= 1; p--)
-        if (set_scheduler(p)) {
+        if (set_scheduler(p) >= 0) {
             pa_log_info("Successfully enabled SCHED_RR scheduling for thread, with priority %i, which is lower than the requested %i.", p, rtprio);
             return 0;
         }
@@ -750,7 +750,7 @@ int pa_raise_priority(int nice_level) {
     }
 
     for (n = nice_level+1; n < 0; n++)
-        if (set_nice(n) > 0) {
+        if (set_nice(n) >= 0) {
             pa_log_info("Successfully acquired nice level %i, which is lower than the requested %i.", n, nice_level);
             return 0;
         }