mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-22 19:00:07 +00:00
Fix BZ #18086 -- nice resets errno to 0.
This commit is contained in:
parent
5011051da3
commit
84895dca70
@ -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>
|
2015-08-10 Ondrej Bilka <neleai@seznam.cz>
|
||||||
|
|
||||||
* sysdeps/powerpc/powerpc64/multiarch/stpcpy.c: Fix ifunc.
|
* sysdeps/powerpc/powerpc64/multiarch/stpcpy.c: Fix ifunc.
|
||||||
|
5
NEWS
5
NEWS
@ -9,8 +9,9 @@ Version 2.23
|
|||||||
|
|
||||||
* The following bugs are resolved with this release:
|
* The following bugs are resolved with this release:
|
||||||
|
|
||||||
16517, 16519, 17905, 18265, 18480, 18525, 18618, 18647, 18661, 18674,
|
16517, 16519, 17905, 18086, 18265, 18480, 18525, 18618, 18647, 18661,
|
||||||
18778, 18781, 18787, 18789, 18790.
|
18674, 18778, 18781, 18787, 18789, 18790.
|
||||||
|
|
||||||
|
|
||||||
Version 2.22
|
Version 2.22
|
||||||
|
|
||||||
|
@ -56,8 +56,17 @@ do_test (void)
|
|||||||
return 1;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,16 +36,16 @@ nice (int incr)
|
|||||||
{
|
{
|
||||||
if (errno != 0)
|
if (errno != 0)
|
||||||
return -1;
|
return -1;
|
||||||
else
|
|
||||||
__set_errno (save);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
result = __setpriority (PRIO_PROCESS, 0, prio + incr);
|
result = __setpriority (PRIO_PROCESS, 0, prio + incr);
|
||||||
if (result == -1)
|
if (result == -1)
|
||||||
{
|
{
|
||||||
if (errno == EACCES)
|
if (errno == EACCES)
|
||||||
errno = EPERM;
|
__set_errno (EPERM);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__set_errno (save);
|
||||||
return __getpriority (PRIO_PROCESS, 0);
|
return __getpriority (PRIO_PROCESS, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user