diff options
-rw-r--r-- | source3/tdb/tdb.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c index 474d0c7adb..944a734ddc 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; } |