summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests/lib/libc/gen/posix_spawn
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2017-02-04 16:47:56 +0000
committerngie <ngie@FreeBSD.org>2017-02-04 16:47:56 +0000
commit3c2d6610b4f395363fd8c565af496d279ab44162 (patch)
tree4233fb25eabacbc7092f9d59c5ffa87b494a1e16 /contrib/netbsd-tests/lib/libc/gen/posix_spawn
parent1a9602695754476d7f89f486f4e040cd432243ef (diff)
downloadFreeBSD-src-3c2d6610b4f395363fd8c565af496d279ab44162.zip
FreeBSD-src-3c2d6610b4f395363fd8c565af496d279ab44162.tar.gz
MFC r311925,r311968,r311969,r312102,r312108:
r311925: Import testcase updates with code contributed back to NetBSD This also (inadvertently) contains an update to contrib/netbsd-tests/lib/libc/sys/t_wait.c (new testcases). In collaboration with: christos@NetBSD.org r311968: Fix lib/libc/sys/access_test after r311925 sys/param.h needs to be #included in order for __FreeBSD_version to be checked r311969: Remove __HAVE_LONG_DOUBLE #define from t_strtod.c and place it in Makefile This is to enable support in other testcases Inspired by lib/msun/tests/Makefile . 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
Diffstat (limited to 'contrib/netbsd-tests/lib/libc/gen/posix_spawn')
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c10
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c12
2 files changed, 11 insertions, 11 deletions
diff --git a/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c
index 5bbf337..74009a8 100644
--- a/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c
+++ b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c
@@ -1,4 +1,4 @@
-/* $NetBSD: t_fileactions.c,v 1.5 2012/04/09 19:42:07 martin Exp $ */
+/* $NetBSD: t_fileactions.c,v 1.6 2017/01/10 22:36:29 christos Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -31,10 +31,11 @@
*/
-#ifdef __FreeBSD__
-#include <sys/stat.h>
-#endif
#include <atf-c.h>
+
+#include <sys/wait.h>
+#include <sys/stat.h>
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -42,7 +43,6 @@
#include <fcntl.h>
#include <spawn.h>
#include <unistd.h>
-#include <sys/wait.h>
ATF_TC(t_spawn_openmode);
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);
OpenPOWER on IntegriCloud