summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2017-02-11 07:35:27 +0000
committerngie <ngie@FreeBSD.org>2017-02-11 07:35:27 +0000
commitbe2fb88bb5cf67a97a0d817e190baf58891b2b67 (patch)
treeb3c42ab6aacfcb2d8cbb56ebf9546ca7c896fbfd
parent90e3ade840a9690b3d0077885b405cf82db86063 (diff)
downloadFreeBSD-src-be2fb88bb5cf67a97a0d817e190baf58891b2b67.zip
FreeBSD-src-be2fb88bb5cf67a97a0d817e190baf58891b2b67.tar.gz
MFC r312102,r312108:
r312102: Note that sys/types.h is required on FreeBSD for kqueue(2), unlike NetBSD r312108: Delete trailing whitespace and use __arraycount instead of nitems in contrib code
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c12
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_sleep.c1
2 files changed, 7 insertions, 6 deletions
diff --git a/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c
index 78313cd..2085b9e 100644
--- a/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c
+++ b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c
@@ -60,16 +60,16 @@ get_different_scheduler(void)
/* get current schedule policy */
scheduler = sched_getscheduler(0);
- for (i = 0; i < nitems(schedulers); i++) {
+ for (i = 0; i < __arraycount(schedulers); i++) {
if (schedulers[i] == scheduler)
break;
}
- ATF_REQUIRE_MSG(i < nitems(schedulers),
+ ATF_REQUIRE_MSG(i < __arraycount(schedulers),
"Unknown current scheduler %d", scheduler);
-
+
/* new scheduler */
i++;
- if (i >= nitems(schedulers))
+ if (i >= __arraycount(schedulers))
i = 0;
return schedulers[i];
}
@@ -85,7 +85,7 @@ get_different_priority(int scheduler)
sched_getparam(0, &param);
priority = param.sched_priority;
-
+
/*
* Change numerical value of the priority, to ensure that it
* was set for the spawned child.
@@ -127,7 +127,7 @@ ATF_TC_BODY(t_spawnattr, tc)
scheduler = get_different_scheduler();
priority = get_different_priority(scheduler);
sp.sched_priority = priority;
-
+
sigemptyset(&sig);
sigaddset(&sig, SIGUSR1);
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_sleep.c b/contrib/netbsd-tests/lib/libc/gen/t_sleep.c
index 5e36456..e85867a 100644
--- a/contrib/netbsd-tests/lib/libc/gen/t_sleep.c
+++ b/contrib/netbsd-tests/lib/libc/gen/t_sleep.c
@@ -27,6 +27,7 @@
*/
#ifdef __FreeBSD__
+/* kqueue(2) on FreeBSD requires sys/types.h for uintptr_t; NetBSD doesn't. */
#include <sys/types.h>
#endif
#include <sys/cdefs.h>
OpenPOWER on IntegriCloud