diff options
author | Renato Botelho <renato@netgate.com> | 2015-12-30 16:21:07 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-12-30 16:21:07 -0200 |
commit | d8ff3484131f428fcc0727cd504acb5050a36490 (patch) | |
tree | 8adfbb5b779f497e621d29277fcbe1536012eeb0 /contrib | |
parent | 0319542cc712df59c57f014b4f925f516bcb5b4b (diff) | |
parent | ecf8336fcdf81e2aeb30a7ab82841dd7299ceb98 (diff) | |
download | FreeBSD-src-d8ff3484131f428fcc0727cd504acb5050a36490.zip FreeBSD-src-d8ff3484131f428fcc0727cd504acb5050a36490.tar.gz |
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/netbsd-tests/lib/libc/gen/t_assert.c | 23 | ||||
-rwxr-xr-x | contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh | 1 | ||||
-rw-r--r-- | contrib/netbsd-tests/usr.bin/grep/d_binary.out | 2 | ||||
-rwxr-xr-x | contrib/netbsd-tests/usr.bin/grep/t_grep.sh | 13 |
4 files changed, 38 insertions, 1 deletions
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_assert.c b/contrib/netbsd-tests/lib/libc/gen/t_assert.c index 140417a..a09c130 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_assert.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_assert.c @@ -40,6 +40,23 @@ __RCSID("$NetBSD: t_assert.c,v 1.2 2011/06/14 05:28:00 jruoho Exp $"); #include <string.h> #include <unistd.h> +#ifdef __FreeBSD__ +#include <sys/types.h> +#include <sys/time.h> +#include <sys/resource.h> + +static void +disable_corefile(void) +{ + struct rlimit limits; + + limits.rlim_cur = 0; + limits.rlim_max = 0; + + ATF_REQUIRE(setrlimit(RLIMIT_CORE, &limits) == 0); +} +#endif + static void handler(int); static void @@ -65,6 +82,9 @@ ATF_TC_BODY(assert_false, tc) if (pid == 0) { +#ifdef __FreeBSD__ + disable_corefile(); +#endif (void)closefrom(0); (void)memset(&sa, 0, sizeof(struct sigaction)); @@ -102,6 +122,9 @@ ATF_TC_BODY(assert_true, tc) if (pid == 0) { +#ifdef __FreeBSD__ + disable_corefile(); +#endif (void)closefrom(0); (void)memset(&sa, 0, sizeof(struct sigaction)); diff --git a/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh b/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh index 04adc67..2986ccf 100755 --- a/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh +++ b/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh @@ -35,6 +35,7 @@ h_fail() { echo "Executing command [ $2$1 ]" # Begin FreeBSD + ulimit -c 0 if true; then eval $2 atf_check -s signal -o ignore -e ignore $1 else diff --git a/contrib/netbsd-tests/usr.bin/grep/d_binary.out b/contrib/netbsd-tests/usr.bin/grep/d_binary.out index ce03056..f0ef988 100644 --- a/contrib/netbsd-tests/usr.bin/grep/d_binary.out +++ b/contrib/netbsd-tests/usr.bin/grep/d_binary.out @@ -1 +1 @@ -Binary file /bin/sh matches +Binary file test.file matches diff --git a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh index f2d70f0..7e53016 100755 --- a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh +++ b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh @@ -43,7 +43,20 @@ binary_head() } binary_body() { + # Begin FreeBSD + # + # Generate stable output instead of depending on uname to match the + # branded OS name of /bin/sh + if true; then + dd if=/dev/zero count=1 of=test.file + echo -n "foobar" >> test.file + atf_check -o file:"$(atf_get_srcdir)/d_binary.out" grep foobar test.file + else + # End FreeBSD atf_check -o file:"$(atf_get_srcdir)/d_binary.out" grep $(uname) /bin/sh + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case recurse |