From a3118e8c6826349b3fc54da3850d6dea994a3a35 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 16 Jan 1997 21:58:40 +0000 Subject: Sweep through the tree fixing mmap() usage: - Use MAP_FAILED instead of the constant -1 to indicate failure (required by POSIX). - Removed flag arguments of '0' (required by POSIX). - Fixed code which expected an error return of 0. - Fixed code which thought any address with the high bit set was an error. - Check for failure where no checks were present. Discussed with: bde --- lib/libc/db/recno/rec_open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libc/db/recno') diff --git a/lib/libc/db/recno/rec_open.c b/lib/libc/db/recno/rec_open.c index 51d8a3c..8f8eff2 100644 --- a/lib/libc/db/recno/rec_open.c +++ b/lib/libc/db/recno/rec_open.c @@ -169,7 +169,7 @@ slow: if ((t->bt_rfp = fdopen(rfd, "r")) == NULL) t->bt_msize = sb.st_size; if ((t->bt_smap = mmap(NULL, t->bt_msize, PROT_READ, MAP_PRIVATE, rfd, - (off_t)0)) == (caddr_t)-1) + (off_t)0)) == MAP_FAILED) goto slow; t->bt_cmap = t->bt_smap; t->bt_emap = t->bt_smap + sb.st_size; -- cgit v1.1