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.
--
========================================================================
Ian Pilcher [email protected]
========================================================================
diff -urNp ../openvpn-1.5.0-orig/misc.c ./misc.c
--- ../openvpn-1.5.0-orig/misc.c 2004-02-09 11:38:59.000000000 -0600
+++ ./misc.c 2004-02-09 12:25:08.000000000 -0600
@@ -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);