svn commit: r313632 - in stable/10/contrib/netbsd-tests/lib/libc/gen: . posix_spawn
Ngie Cooper
ngie at FreeBSD.org
Sat Feb 11 07:35:29 UTC 2017
Author: ngie
Date: Sat Feb 11 07:35:27 2017
New Revision: 313632
URL: https://svnweb.freebsd.org/changeset/base/313632
Log:
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
Modified:
stable/10/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c
stable/10/contrib/netbsd-tests/lib/libc/gen/t_sleep.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c
==============================================================================
--- stable/10/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c Sat Feb 11 07:14:45 2017 (r313631)
+++ stable/10/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c Sat Feb 11 07:35:27 2017 (r313632)
@@ -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, ¶m);
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);
Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_sleep.c
==============================================================================
--- stable/10/contrib/netbsd-tests/lib/libc/gen/t_sleep.c Sat Feb 11 07:14:45 2017 (r313631)
+++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_sleep.c Sat Feb 11 07:35:27 2017 (r313632)
@@ -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>
More information about the svn-src-stable
mailing list