From 6a7a8b22f64f780e8749edca9f998ebba6fdef4f Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Tue, 5 Jun 2001 06:21:21 +0000 Subject: Update. 2001-06-05 Andreas Jaeger * manual/libm-err-tab.pl (parse_ulps): Fix typo. 2001-06-04 H.J. Lu * sysdeps/alpha/elf/start.S: Add .type for the entry point. * sysdeps/arm/elf/start.S: Likewise. * sysdeps/hppa/elf/start.S: Likewise. * sysdeps/i386/elf/start.S: Likewise. * sysdeps/m68k/elf/start.S: Likewise. * sysdeps/mips/elf/start.S: Likewise. * sysdeps/ia64/elf/start.S: Likewise. * sysdeps/sh/elf/start.S: Likewise. * sysdeps/s390/s390-32/elf/start.S: Likewise. * sysdeps/s390/s390-64/elf/start.S: Likewise. * sysdeps/cris/elf/start.S: Likewise. 2001-06-04 Bruce Mitchener * manual/resource.texi: Correct setpriority/nice documentation. * sysdeps/unix/nice.c: Correct nice() implementation. --- sysdeps/unix/nice.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'sysdeps/unix') diff --git a/sysdeps/unix/nice.c b/sysdeps/unix/nice.c index ffde93f3c2..17d07376bc 100644 --- a/sysdeps/unix/nice.c +++ b/sysdeps/unix/nice.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1996, 1997, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -23,11 +23,11 @@ /* Increment the scheduling priority of the calling process by INCR. The superuser may use a negative INCR to decrement the priority. */ int -nice (incr) - int incr; +nice (int incr) { int save; int prio; + int result; /* -1 is a valid priority, so we use errno to check for an error. */ save = errno; @@ -41,5 +41,10 @@ nice (incr) __set_errno (save); } - return setpriority (PRIO_PROCESS, 0, prio + incr); + result = setpriority (PRIO_PROCESS, 0, prio + incr); + if (result != -1) + return prio + incr; + else + return -1; + } -- cgit v1.2.3-70-g09d2