aboutsummaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/misc.c b/misc.c
index 1f7f616..f5ce590 100644
--- a/misc.c
+++ b/misc.c
@@ -155,9 +155,8 @@ set_nice (int niceval)
{
#ifdef HAVE_NICE
errno = 0;
- nice (niceval);
- if (errno != 0)
- msg (M_WARN | M_ERRNO, "WARNING: nice %d failed", niceval);
+ if (nice (niceval) < 0 && errno != 0)
+ msg (M_WARN | M_ERRNO, "WARNING: nice %d failed: %s", niceval, strerror(errno));
else
msg (M_INFO, "nice %d succeeded", niceval);
#else