This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.22-53-g84895dc


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  84895dca70f972df3842fb88f7b33b5d695cc599 (commit)
      from  5011051da35a91577d262040791cbe5a868cffbd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=84895dca70f972df3842fb88f7b33b5d695cc599

commit 84895dca70f972df3842fb88f7b33b5d695cc599
Author: Paul Pluzhnikov <ppluzhnikov@google.com>
Date:   Tue Aug 11 23:40:00 2015 -0700

    Fix BZ #18086 -- nice resets errno to 0.

diff --git a/ChangeLog b/ChangeLog
index af87ce2..24e029e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-08-11  Paul Pluzhnikov  <ppluzhnikov@google.com>
+
+	[BZ #18086]
+	* sysdeps/posix/nice.c (nice): Restore old errno.
+	* posix/tst-nice.c (do_test): Add test for BZ #18086.
+
 2015-08-10  Ondrej Bilka  <neleai@seznam.cz>
 
 	* sysdeps/powerpc/powerpc64/multiarch/stpcpy.c: Fix ifunc.
diff --git a/NEWS b/NEWS
index 1b11ce7..c6a2c2c 100644
--- a/NEWS
+++ b/NEWS
@@ -9,8 +9,9 @@ Version 2.23
 
 * The following bugs are resolved with this release:
 
-  16517, 16519, 17905, 18265, 18480, 18525, 18618, 18647, 18661, 18674,
-  18778, 18781, 18787, 18789, 18790.
+  16517, 16519, 17905, 18086, 18265, 18480, 18525, 18618, 18647, 18661,
+  18674, 18778, 18781, 18787, 18789, 18790.
+
 
 Version 2.22
 
diff --git a/posix/tst-nice.c b/posix/tst-nice.c
index ac78d60..814891d 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;
 }
 
diff --git a/sysdeps/posix/nice.c b/sysdeps/posix/nice.c
index 42bb99b..8f6daaf 100644
--- a/sysdeps/posix/nice.c
+++ b/sysdeps/posix/nice.c
@@ -36,16 +36,16 @@ nice (int incr)
     {
       if (errno != 0)
 	return -1;
-      else
-	__set_errno (save);
     }
 
   result = __setpriority (PRIO_PROCESS, 0, prio + incr);
   if (result == -1)
     {
       if (errno == EACCES)
-	errno = EPERM;
+	__set_errno (EPERM);
       return -1;
     }
+
+  __set_errno (save);
   return __getpriority (PRIO_PROCESS, 0);
 }

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog            |    6 ++++++
 NEWS                 |    5 +++--
 posix/tst-nice.c     |   11 ++++++++++-
 sysdeps/posix/nice.c |    6 +++---
 4 files changed, 22 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]