nice() return value is unreliable
Attached is a small patch to set_nice() in misc.c that uses errno, rather than nice()'s return value to determine if the call succeeded. See 'man 2 nice' on a recent Linux distribution for why checking the return value is unreliable.
Signature · 3 lines
======================================================================== Ian Pilcher [email protected]... ========================================================================
misc.c renamed from openvpn-1.5.0-orig/misc.c +3 -1
@@ -139,7 +139,9 @@ set_nice (int niceval)if (niceval) {#ifdef HAVE_NICE -if (nice (niceval) <0 ) + errno =0 ; +nice (niceval); +if (errno !=0 )msg (M_WARN |M_ERRNO ,"WARNING: nice %d failed" , niceval);else msg (M_INFO ,"nice %d succeeded" , niceval);