From 84895dca70f972df3842fb88f7b33b5d695cc599 Mon Sep 17 00:00:00 2001 From: Paul Pluzhnikov Date: Tue, 11 Aug 2015 23:40:00 -0700 Subject: Fix BZ #18086 -- nice resets errno to 0. --- posix/tst-nice.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'posix') 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; } -- cgit v1.2.3-70-g09d2