diff options
| author | Enji Cooper <ngie@FreeBSD.org> | 2015-11-09 06:16:38 +0000 |
|---|---|---|
| committer | Enji Cooper <ngie@FreeBSD.org> | 2015-11-09 06:16:38 +0000 |
| commit | 233193f1e6c4f3a3f9c546458cdfc0342dcc3c91 (patch) | |
| tree | 2b72c7a228a9bf90d7882e3b5d7f75394d8d4373 | |
| parent | 7c49f4218a8d9eff2a254762864f12eb931d0e74 (diff) | |
Notes
| -rw-r--r-- | lib/libc/tests/gen/arc4random_test.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/libc/tests/gen/arc4random_test.c b/lib/libc/tests/gen/arc4random_test.c index ec82c3272d2a..a28db303e88c 100644 --- a/lib/libc/tests/gen/arc4random_test.c +++ b/lib/libc/tests/gen/arc4random_test.c @@ -30,10 +30,12 @@ __FBSDID("$FreeBSD$"); #include <sys/types.h> #include <sys/mman.h> #include <sys/wait.h> +#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> + #include <atf-c.h> /* @@ -56,14 +58,9 @@ ATF_TC_BODY(test_arc4random, tc) pid_t pid; char c; - printf("1..1\n"); - page = mmap(NULL, sizeof(struct shared_page), PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0); - if (page == MAP_FAILED) { - printf("fail 1 - mmap\n"); - exit(1); - } + ATF_REQUIRE_MSG(page != MAP_FAILED, "mmap failed; errno=%d", errno); arc4random_buf(&c, 1); |
