diff options
author | Tim Potter <tpot@samba.org> | 2001-01-16 18:33:05 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2001-01-16 18:33:05 +0000 |
commit | cef7f58ac5cc0c96e1027c7e5ecbb3fb72cb94b6 (patch) | |
tree | 66b22d059391777d0bc2ab63a6fec5722887af7f /source/tdb | |
parent | 6a1f55b3255f216a5ddc73f94c6cb5a2490c3bbb (diff) | |
download | samba-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.c | 3 |
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; } |