diff options
author | Doug Hogan <doug@cvs.openbsd.org> | 2014-09-27 06:28:46 +0000 |
---|---|---|
committer | Doug Hogan <doug@cvs.openbsd.org> | 2014-09-27 06:28:46 +0000 |
commit | c2c41019dccafa128c9c0b6cd0545526e58461be (patch) | |
tree | 3ca68d0f221226c7fdf3e8c47c1a219052e94c2e /regress/sys/kern/mmap3 | |
parent | 01fe706a518a954b84ed44e18ff408cb4e7525ee (diff) |
Fix mmap() calls that check for a result other than MAP_FAILED.
ok tedu@
Diffstat (limited to 'regress/sys/kern/mmap3')
-rw-r--r-- | regress/sys/kern/mmap3/mmaptest.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/regress/sys/kern/mmap3/mmaptest.c b/regress/sys/kern/mmap3/mmaptest.c index 1318d46c41f..1e8ee706910 100644 --- a/regress/sys/kern/mmap3/mmaptest.c +++ b/regress/sys/kern/mmap3/mmaptest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mmaptest.c,v 1.6 2006/02/20 17:03:27 mickey Exp $ */ +/* $OpenBSD: mmaptest.c,v 1.7 2014/09/27 06:28:45 doug Exp $ */ /* * Copyright (c) 2002 Marc Espie. * @@ -58,7 +58,7 @@ main(int argc, char *argv[]) if (fd == -1) err(1, "open(test.out) 2"); a2 = mmap(NULL, AREA, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); - if (!a2) + if (a2 == MAP_FAILED) err(1, "mmap"); a2[10] = 3; msync(a2, AREA, MS_SYNC|MS_INVALIDATE); |