summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2015-02-22 13:36:44 +0000
committerjilles <jilles@FreeBSD.org>2015-02-22 13:36:44 +0000
commit2ccd6e68c094b9b2cf3e45ba6ec6bc2f7d8639c3 (patch)
treea3d75931bf4330ec79e55c4bdafaa79dd097e2de /contrib/netbsd-tests
parent4928f50790f7155b2d89dce045fd1c924bb57fc4 (diff)
downloadFreeBSD-src-2ccd6e68c094b9b2cf3e45ba6ec6bc2f7d8639c3.zip
FreeBSD-src-2ccd6e68c094b9b2cf3e45ba6ec6bc2f7d8639c3.tar.gz
nice(): Correct return value and [EPERM] error.
PR: 189821 Obtained from: NetBSD Relnotes: yes
Diffstat (limited to 'contrib/netbsd-tests')
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_nice.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_nice.c b/contrib/netbsd-tests/lib/libc/gen/t_nice.c
index 10b8df7..f4a62e9 100644
--- a/contrib/netbsd-tests/lib/libc/gen/t_nice.c
+++ b/contrib/netbsd-tests/lib/libc/gen/t_nice.c
@@ -72,11 +72,6 @@ ATF_TC_BODY(nice_err, tc)
{
int i;
-#ifdef __FreeBSD__
- atf_tc_expect_fail("nice(incr) with incr < 0 fails with unprivileged "
- "users and sets errno == EPERM; see PR # 189821 for more details");
-#endif
-
/*
* The call should fail with EPERM if the
* supplied parameter is negative and the
@@ -98,11 +93,7 @@ ATF_TC_HEAD(nice_priority, tc)
ATF_TC_BODY(nice_priority, tc)
{
-#ifdef __FreeBSD__
- int i, pri, pri2, nic;
-#else
int i, pri, nic;
-#endif
pid_t pid;
int sta;
@@ -115,10 +106,8 @@ ATF_TC_BODY(nice_priority, tc)
pri = getpriority(PRIO_PROCESS, 0);
ATF_REQUIRE(errno == 0);
-#ifdef __NetBSD__
if (nic != pri)
atf_tc_fail("nice(3) and getpriority(2) conflict");
-#endif
/*
* Also verify that the nice(3) values
@@ -130,18 +119,10 @@ ATF_TC_BODY(nice_priority, tc)
if (pid == 0) {
errno = 0;
-#ifdef __FreeBSD__
pri = getpriority(PRIO_PROCESS, 0);
-#else
- pri2 = getpriority(PRIO_PROCESS, 0);
-#endif
ATF_REQUIRE(errno == 0);
-#ifdef __FreeBSD__
- if (pri != pri2)
-#else
if (nic != pri)
-#endif
_exit(EXIT_FAILURE);
_exit(EXIT_SUCCESS);
@@ -180,11 +161,7 @@ ATF_TC_HEAD(nice_thread, tc)
ATF_TC_BODY(nice_thread, tc)
{
pthread_t tid[5];
-#ifdef __FreeBSD__
- int pri, rv, val;
-#else
int rv, val;
-#endif
size_t i;
/*
@@ -196,12 +173,7 @@ ATF_TC_BODY(nice_thread, tc)
val = nice(i);
ATF_REQUIRE(val != -1);
-#ifdef __FreeBSD__
- pri = getpriority(PRIO_PROCESS, 0);
- rv = pthread_create(&tid[i], NULL, threadfunc, &pri);
-#else
rv = pthread_create(&tid[i], NULL, threadfunc, &val);
-#endif
ATF_REQUIRE(rv == 0);
rv = pthread_join(tid[i], NULL);
OpenPOWER on IntegriCloud