summaryrefslogtreecommitdiffstats
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
commit73ba07b3623022e1bde22721b67dba769cc7a1f2 (patch)
tree2fee4de7e897303ce530cef27e67d918bae86889
parentb85d1ecc2661cd2db8e7992dc2aa587a24392bb1 (diff)
downloadsamba-73ba07b3623022e1bde22721b67dba769cc7a1f2.tar.gz
samba-73ba07b3623022e1bde22721b67dba769cc7a1f2.tar.xz
samba-73ba07b3623022e1bde22721b67dba769cc7a1f2.zip
Set the tdb->map_ptr to NULL if mmap() returns -1.
(This used to be commit cef7f58ac5cc0c96e1027c7e5ecbb3fb72cb94b6)
-rw-r--r--source3/tdb/tdb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c
index 474d0c7adb3..944a734ddc3 100644
--- a/source3/tdb/tdb.c
+++ b/source3/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;
}