about summary refs log tree commit diff
path: root/posix/tst-nice.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-03-19 23:03:56 +0000
committerUlrich Drepper <drepper@redhat.com>2003-03-19 23:03:56 +0000
commit8c937b84395e9e85d4f5a6a8cd1a7175539fb53b (patch)
treeb3f82d695aea6d68d8a7e9fe29c2ca6f76d4305d /posix/tst-nice.c
parentcb8ed9413e7e3d645e00ad130061a933cc74fb60 (diff)
downloadglibc-8c937b84395e9e85d4f5a6a8cd1a7175539fb53b.tar.gz
glibc-8c937b84395e9e85d4f5a6a8cd1a7175539fb53b.tar.xz
glibc-8c937b84395e9e85d4f5a6a8cd1a7175539fb53b.zip
Update.
2003-03-19  Ulrich Drepper  <drepper@redhat.com>

	* posix/tst-nice.c (do_test): Remove invalid of return value.
	Don't run test if initial level != 0.
Diffstat (limited to 'posix/tst-nice.c')
-rw-r--r--posix/tst-nice.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/posix/tst-nice.c b/posix/tst-nice.c
index d5833c33fc..07fe67eafa 100644
--- a/posix/tst-nice.c
+++ b/posix/tst-nice.c
@@ -25,8 +25,9 @@
 static int
 do_test (void)
 {
-  int ret, expected;
+  int ret;
   const int incr = 10;
+  const int expected = 10;
 
   /* Discover current nice value.  */
   errno = 0;
@@ -36,7 +37,11 @@ do_test (void)
       printf ("break: nice(%d) return: %d, errno: %d\n", 0, ret, errno);
       return 1;
     }
-  expected = ret + incr;
+  /* We cannot generally add up the increments since the values are
+     capped.  So we run the test only if we initially run at level
+     0.  */
+  if (ret != 0)
+    return 0;
 
   /* Nice ourselves up.  */
   errno = 0;
@@ -49,7 +54,7 @@ do_test (void)
 
   /* Check for return value being zero when it shouldn't.  Cannot simply
      check for expected value since nice values are capped at 2^n-1.  */
-  if (ret == 0 && ret != expected)
+  if (ret != expected)
     {
       printf ("fail: retval (%d) of nice(%d) != %d\n", ret, incr, expected);
       return 1;