diff options
author | ngie <ngie@FreeBSD.org> | 2017-02-04 16:47:56 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2017-02-04 16:47:56 +0000 |
commit | 3c2d6610b4f395363fd8c565af496d279ab44162 (patch) | |
tree | 4233fb25eabacbc7092f9d59c5ffa87b494a1e16 /contrib/netbsd-tests/lib/libc/gen/t_dir.c | |
parent | 1a9602695754476d7f89f486f4e040cd432243ef (diff) | |
download | FreeBSD-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/t_dir.c')
-rw-r--r-- | contrib/netbsd-tests/lib/libc/gen/t_dir.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_dir.c b/contrib/netbsd-tests/lib/libc/gen/t_dir.c index 3b4c6cb..c058738 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_dir.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_dir.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_dir.c,v 1.6 2013/10/19 17:45:00 christos Exp $ */ +/* $NetBSD: t_dir.c,v 1.8 2017/01/11 07:26:17 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -26,22 +26,19 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <atf-c.h> - +#include <sys/stat.h> #include <assert.h> +#include <atf-c.h> #include <dirent.h> #include <err.h> +#include <errno.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <sys/stat.h> -#ifdef __FreeBSD__ -#include <errno.h> -#endif ATF_TC(seekdir_basic); ATF_TC_HEAD(seekdir_basic, tc) @@ -58,7 +55,6 @@ ATF_TC_BODY(seekdir_basic, tc) struct dirent *entry; long here; -#ifdef __FreeBSD__ #define CREAT(x, m) do { \ int _creat_fd; \ ATF_REQUIRE_MSG((_creat_fd = creat((x), (m))) != -1, \ @@ -72,12 +68,6 @@ ATF_TC_BODY(seekdir_basic, tc) CREAT("t/a", 0600); CREAT("t/b", 0600); CREAT("t/c", 0600); -#else - mkdir("t", 0755); - creat("t/a", 0600); - creat("t/b", 0600); - creat("t/c", 0600); -#endif dp = opendir("t"); if ( dp == NULL) @@ -90,10 +80,8 @@ ATF_TC_BODY(seekdir_basic, tc) /* get first entry */ entry = readdir(dp); here = telldir(dp); -#ifdef __FreeBSD__ ATF_REQUIRE_MSG(here != -1, "telldir failed: %s", strerror(errno)); -#endif /* get second entry */ entry = readdir(dp); @@ -137,9 +125,7 @@ ATF_TC_BODY(seekdir_basic, tc) atf_tc_fail("3rd seekdir found wrong name"); closedir(dp); -#ifdef __FreeBSD__ free(wasname); -#endif } /* There is no sbrk on AArch64 and RISC-V */ |