Make return value of SetPriorityClass() behave the same as setpriority().
[tinc] / src / tincd.c
index 40ac038..b3d911b 100644 (file)
@@ -504,7 +504,7 @@ static bool drop_privs() {
 }
 
 #ifdef HAVE_MINGW
-# define setpriority(level) SetPriorityClass(GetCurrentProcess(), (level))
+# define setpriority(level) !SetPriorityClass(GetCurrentProcess(), (level))
 #else
 # define NORMAL_PRIORITY_CLASS 0
 # define BELOW_NORMAL_PRIORITY_CLASS 10