summaryrefslogtreecommitdiffstats
path: root/regress/lib/libc/mkstemp/mkstemp_test.c
diff options
context:
space:
mode:
authordoug <doug@openbsd.org>2014-09-27 06:28:45 +0000
committerdoug <doug@openbsd.org>2014-09-27 06:28:45 +0000
commit66ac7e0f41afa5ee38be0f647d036d1b3410f7fc (patch)
treec40f33e7bcbfbd027cac34246a308ca9db01c7fe /regress/lib/libc/mkstemp/mkstemp_test.c
parentChange spaces to tab. No binary change. (diff)
downloadwireguard-openbsd-66ac7e0f41afa5ee38be0f647d036d1b3410f7fc.tar.xz
wireguard-openbsd-66ac7e0f41afa5ee38be0f647d036d1b3410f7fc.zip
Fix mmap() calls that check for a result other than MAP_FAILED.
ok tedu@
Diffstat (limited to 'regress/lib/libc/mkstemp/mkstemp_test.c')
-rw-r--r--regress/lib/libc/mkstemp/mkstemp_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/regress/lib/libc/mkstemp/mkstemp_test.c b/regress/lib/libc/mkstemp/mkstemp_test.c
index ef973b061b6..c1c05eae39d 100644
--- a/regress/lib/libc/mkstemp/mkstemp_test.c
+++ b/regress/lib/libc/mkstemp/mkstemp_test.c
@@ -122,7 +122,7 @@ main(void)
cwd[clen++] = '/';
cwd[clen] = '\0';
p = mmap(NULL, pg * 3, PROT_READ | PROT_WRITE, MAP_ANON, -1, 0);
- if (p == NULL)
+ if (p == MAP_FAILED)
err(1, "mmap");
if (mprotect(p, pg, PROT_NONE) || mprotect(p + pg * 2, pg, PROT_NONE))
err(1, "mprotect");