summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests/lib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/netbsd-tests/lib/libc')
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_fexecve.c3
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_mkfifoat.c3
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_mknodat.c3
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_ftok.c3
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c3
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_ttyname.c3
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_strchr.c12
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_strlen.c11
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_kevent.c3
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_listen.c3
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_mincore.c3
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_pipe.c3
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_revoke.c3
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c3
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_stat.c3
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_umask.c3
-rw-r--r--contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c3
17 files changed, 67 insertions, 1 deletions
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_fexecve.c b/contrib/netbsd-tests/lib/libc/c063/t_fexecve.c
index d557b00..30b26a7 100644
--- a/contrib/netbsd-tests/lib/libc/c063/t_fexecve.c
+++ b/contrib/netbsd-tests/lib/libc/c063/t_fexecve.c
@@ -70,6 +70,9 @@ ATF_TC_BODY(fexecve, tc)
error = 76;
else
error = EXIT_FAILURE;
+#ifdef __FreeBSD__
+ (void)close(fd);
+#endif
err(error, "fexecve");
}
}
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_mkfifoat.c b/contrib/netbsd-tests/lib/libc/c063/t_mkfifoat.c
index 1ae023c..3736dfa 100644
--- a/contrib/netbsd-tests/lib/libc/c063/t_mkfifoat.c
+++ b/contrib/netbsd-tests/lib/libc/c063/t_mkfifoat.c
@@ -63,6 +63,9 @@ ATF_TC_BODY(mkfifoat_fd, tc)
ATF_REQUIRE((fd = mkfifoat(dfd, BASEFIFO, mode)) != -1);
ATF_REQUIRE(close(fd) == 0);
ATF_REQUIRE(access(FIFO, F_OK) == 0);
+#ifdef __FreeBSD__
+ (void)close(dfd);
+#endif
}
ATF_TC(mkfifoat_fdcwd);
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c b/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c
index b04a159..e8f71cd 100644
--- a/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c
+++ b/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c
@@ -80,6 +80,9 @@ ATF_TC_BODY(mknodat_fd, tc)
ATF_REQUIRE((fd = mknodat(dfd, BASEFILE, mode, dev)) != -1);
ATF_REQUIRE(close(fd) == 0);
ATF_REQUIRE(access(FILE, F_OK) == 0);
+#ifdef __FreeBSD__
+ (void)close(dfd);
+#endif
}
ATF_TC(mknodat_fdcwd);
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_ftok.c b/contrib/netbsd-tests/lib/libc/gen/t_ftok.c
index 100bd1b..718d310 100644
--- a/contrib/netbsd-tests/lib/libc/gen/t_ftok.c
+++ b/contrib/netbsd-tests/lib/libc/gen/t_ftok.c
@@ -68,6 +68,9 @@ ATF_TC_BODY(ftok_link, tc)
fd = open(path, O_RDONLY | O_CREAT);
ATF_REQUIRE(fd >= 0);
+#ifdef __FreeBSD__
+ (void)close(fd);
+#endif
ATF_REQUIRE(link(path, hlnk) == 0);
ATF_REQUIRE(symlink(path, slnk) == 0);
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c b/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c
index 5836c86..53055d2 100644
--- a/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c
+++ b/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c
@@ -247,6 +247,9 @@ ATF_TC_BODY(humanize_number_basic, tc)
newline();
atf_tc_fail_nonfatal("Failed for table entry %d", i);
}
+#ifdef __FreeBSD__
+ free(buf);
+#endif
}
ATF_TC(humanize_number_big);
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c b/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c
index 0c10c24..1c813fb 100644
--- a/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c
+++ b/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c
@@ -78,6 +78,9 @@ ATF_TC_BODY(ttyname_err, tc)
ATF_REQUIRE(ttyname(fd) == NULL);
ATF_REQUIRE(errno == ENOTTY);
+#ifdef __FreeBSD__
+ (void)close(fd);
+#endif
}
}
diff --git a/contrib/netbsd-tests/lib/libc/string/t_strchr.c b/contrib/netbsd-tests/lib/libc/string/t_strchr.c
index 958b186..4556b2c 100644
--- a/contrib/netbsd-tests/lib/libc/string/t_strchr.c
+++ b/contrib/netbsd-tests/lib/libc/string/t_strchr.c
@@ -58,6 +58,9 @@ ATF_TC_HEAD(strchr_basic, tc)
ATF_TC_BODY(strchr_basic, tc)
{
+#ifdef __FreeBSD__
+ void *dl_handle;
+#endif
unsigned int t, a;
char *off;
char buf[32];
@@ -245,8 +248,12 @@ ATF_TC_BODY(strchr_basic, tc)
"abcdefgh/abcdefgh/",
};
-
+#ifdef __FreeBSD__
+ dl_handle = dlopen(NULL, RTLD_LAZY);
+ strchr_fn = dlsym(dl_handle, "test_strlen");
+#else
strchr_fn = dlsym(dlopen(0, RTLD_LAZY), "test_strchr");
+#endif
if (!strchr_fn)
strchr_fn = strchr;
@@ -281,6 +288,9 @@ ATF_TC_BODY(strchr_basic, tc)
verify_strchr(buf + a, 0xff, t, a);
}
}
+#ifdef __FreeBSD__
+ (void)dlclose(dl_handle);
+#endif
}
ATF_TP_ADD_TCS(tp)
diff --git a/contrib/netbsd-tests/lib/libc/string/t_strlen.c b/contrib/netbsd-tests/lib/libc/string/t_strlen.c
index 66158fd..7483dc6 100644
--- a/contrib/netbsd-tests/lib/libc/string/t_strlen.c
+++ b/contrib/netbsd-tests/lib/libc/string/t_strlen.c
@@ -40,6 +40,9 @@ ATF_TC_HEAD(strlen_basic, tc)
ATF_TC_BODY(strlen_basic, tc)
{
+#ifdef __FreeBSD__
+ void *dl_handle;
+#endif
/* try to trick the compiler */
size_t (*strlen_fn)(const char *);
@@ -107,7 +110,12 @@ ATF_TC_BODY(strlen_basic, tc)
* During testing it is useful have the rest of the program
* use a known good version!
*/
+#ifdef __FreeBSD__
+ dl_handle = dlopen(NULL, RTLD_LAZY);
+ strlen_fn = dlsym(dl_handle, "test_strlen");
+#else
strlen_fn = dlsym(dlopen(NULL, RTLD_LAZY), "test_strlen");
+#endif
if (!strlen_fn)
strlen_fn = strlen;
@@ -134,6 +142,9 @@ ATF_TC_BODY(strlen_basic, tc)
}
}
}
+#ifdef __FreeBSD__
+ (void)dlclose(dl_handle);
+#endif
}
ATF_TC(strlen_huge);
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_kevent.c b/contrib/netbsd-tests/lib/libc/sys/t_kevent.c
index 3858554..8a20d63 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_kevent.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_kevent.c
@@ -101,6 +101,9 @@ ATF_TC_BODY(kqueue_desc_passing, tc)
m.msg_namelen = 0;
m.msg_control = msg;
m.msg_controllen = CMSG_SPACE(sizeof(int));
+#ifdef __FreeBSD__
+ m.msg_flags = 0;
+#endif
child = fork();
if (child == 0) {
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_listen.c b/contrib/netbsd-tests/lib/libc/sys/t_listen.c
index d7c7d9e..a9ee733 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_listen.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_listen.c
@@ -110,6 +110,9 @@ ATF_TC_BODY(listen_low_port, tc)
int sd, val;
sd = socket(AF_INET, SOCK_STREAM, 0);
+#ifdef __FreeBSD__
+ ATF_REQUIRE_MSG(sd != -1, "socket failed: %s", strerror(errno));
+#endif
val = IP_PORTRANGE_LOW;
if (setsockopt(sd, IPPROTO_IP, IP_PORTRANGE, &val,
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_mincore.c b/contrib/netbsd-tests/lib/libc/sys/t_mincore.c
index 72355e2..c31170f 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_mincore.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_mincore.c
@@ -279,6 +279,9 @@ ATF_TC_BODY(mincore_resid, tc)
(void)munmap(addr2, npgs * page);
(void)munmap(addr3, npgs * page);
(void)unlink(path);
+#ifdef __FreeBSD__
+ free(buf);
+#endif
}
ATF_TC_CLEANUP(mincore_resid, tc)
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_pipe.c b/contrib/netbsd-tests/lib/libc/sys/t_pipe.c
index b30b94d..32beecc 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_pipe.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_pipe.c
@@ -153,6 +153,9 @@ ATF_TC_BODY(pipe_restart, tc)
ATF_REQUIRE_EQ(WEXITSTATUS(st), 0);
}
+#ifdef __FreeBSD__
+ free(f);
+#endif
}
ATF_TP_ADD_TCS(tp)
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_revoke.c b/contrib/netbsd-tests/lib/libc/sys/t_revoke.c
index 926d2740..8e4c2a3 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_revoke.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_revoke.c
@@ -176,6 +176,9 @@ ATF_TC_BODY(revoke_perm, tc)
if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
atf_tc_fail("revoke(2) did not obey permissions");
+#ifdef __FreeBSD__
+ (void)close(fd);
+#endif
ATF_REQUIRE(unlink(path) == 0);
}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c b/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c
index 84b0149..f1100bf 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c
@@ -124,6 +124,9 @@ out:
if (lim != 0)
atf_tc_fail("failed to set limit (%d)", lim);
+#ifdef __FreeBSD__
+ free(buf);
+#endif
}
ATF_TC(setrlimit_current);
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_stat.c b/contrib/netbsd-tests/lib/libc/sys/t_stat.c
index 5e1d17e..300c6e8 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_stat.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_stat.c
@@ -398,6 +398,9 @@ ATF_TC_BODY(stat_symlink, tc)
ATF_REQUIRE(unlink(path) == 0);
ATF_REQUIRE(unlink(pathlink) == 0);
+#ifdef __FreeBSD__
+ (void)close(fd);
+#endif
}
ATF_TC_CLEANUP(stat_symlink, tc)
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_umask.c b/contrib/netbsd-tests/lib/libc/sys/t_umask.c
index 748cbdc..7a65574 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_umask.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_umask.c
@@ -129,6 +129,9 @@ ATF_TC_BODY(umask_open, tc)
if (fd < 0)
continue;
+#ifdef __FreeBSD__
+ (void)close(fd);
+#endif
(void)memset(&st, 0, sizeof(struct stat));
if (stat(path, &st) != 0) {
diff --git a/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c b/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c
index 5a5ec0f..1e42536 100644
--- a/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c
+++ b/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c
@@ -152,6 +152,9 @@ ATF_TC_BODY(ioctl, tc)
REQUIRE_ERRNO(sigaction(SIGCHLD, &sa, NULL), -1);
(void) wait(NULL);
+#ifdef __FreeBSD__
+ (void)close(s);
+#endif
ATF_REQUIRE_EQ(rc, 0);
}
OpenPOWER on IntegriCloud