summaryrefslogtreecommitdiff
path: root/source/tdb
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-01-16 18:33:05 +0000
committerTim Potter <tpot@samba.org>2001-01-16 18:33:05 +0000
commitcef7f58ac5cc0c96e1027c7e5ecbb3fb72cb94b6 (patch)
tree66b22d059391777d0bc2ab63a6fec5722887af7f /source/tdb
parent6a1f55b3255f216a5ddc73f94c6cb5a2490c3bbb (diff)
downloadsamba-cef7f58ac5cc0c96e1027c7e5ecbb3fb72cb94b6.tar.gz
Set the tdb->map_ptr to NULL if mmap() returns -1.
Diffstat (limited to 'source/tdb')
-rw-r--r--source/tdb/tdb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/tdb/tdb.c b/source/tdb/tdb.c
index 474d0c7adb3..944a734ddc3 100644
--- a/source/tdb/tdb.c
+++ b/source/tdb/tdb.c
@@ -85,6 +85,9 @@ static void *tdb_mmap(tdb_len size, int readonly, int fd)
#ifdef HAVE_MMAP
ret = mmap(NULL, size, PROT_READ | (readonly ? 0 : PROT_WRITE), MAP_SHARED|MAP_FILE, fd, 0);
#endif
+ if (ret == (void *)-1)
+ ret = NULL;
+
return ret;
}