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 /sbin | |
parent | 01fe706a518a954b84ed44e18ff408cb4e7525ee (diff) |
Fix mmap() calls that check for a result other than MAP_FAILED.
ok tedu@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/newfs_ext2fs/mke2fs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/newfs_ext2fs/mke2fs.c b/sbin/newfs_ext2fs/mke2fs.c index 0be794dd26d..e47ffe42adb 100644 --- a/sbin/newfs_ext2fs/mke2fs.c +++ b/sbin/newfs_ext2fs/mke2fs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mke2fs.c,v 1.11 2014/07/31 19:49:25 pelikan Exp $ */ +/* $OpenBSD: mke2fs.c,v 1.12 2014/09/27 06:28:45 doug Exp $ */ /* $NetBSD: mke2fs.c,v 1.13 2009/10/19 18:41:08 bouyer Exp $ */ /*- @@ -532,7 +532,7 @@ mke2fs(const char *fsys, int fi, int fo) iobufsize = (NBLOCK_SUPERBLOCK + sblock.e2fs_ngdb) * sblock.e2fs_bsize; iobuf = mmap(0, iobufsize, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0); - if (iobuf == NULL) + if (iobuf == MAP_FAILED) errx(EXIT_FAILURE, "Cannot allocate I/O buffer\n"); memset(iobuf, 0, iobufsize); |