about summary refs log tree commit diff
path: root/posix
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2015-08-11 23:40:00 -0700
committerPaul Pluzhnikov <ppluzhnikov@google.com>2015-08-11 23:40:00 -0700
commit84895dca70f972df3842fb88f7b33b5d695cc599 (patch)
treeade512ca77f27f09e58435878cec1c640dfaed88 /posix
parent5011051da35a91577d262040791cbe5a868cffbd (diff)
downloadglibc-84895dca70f972df3842fb88f7b33b5d695cc599.tar.gz
glibc-84895dca70f972df3842fb88f7b33b5d695cc599.tar.xz
glibc-84895dca70f972df3842fb88f7b33b5d695cc599.zip
Fix BZ #18086 -- nice resets errno to 0.
Diffstat (limited to 'posix')
-rw-r--r--posix/tst-nice.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/posix/tst-nice.c b/posix/tst-nice.c
index ac78d6056f..814891deb6 100644
--- a/posix/tst-nice.c
+++ b/posix/tst-nice.c
@@ -56,8 +56,17 @@ do_test (void)
       return 1;
     }
 
-  printf ("PASS: nice(%d) from %d return: %d\n", incr, old, ret);
+  /* BZ #18086. Make sure we don't reset errno.  */
+  errno = EBADF;
+  nice (0);
+  if (errno != EBADF)
+    {
+      printf ("FAIL: errno = %i, but wanted EBADF (%i)\n", errno, EBADF);
+      return 1;
+    }
+
 
+  printf ("PASS: nice(%d) from %d return: %d\n", incr, old, ret);
   return 0;
 }