From 73ba07b3623022e1bde22721b67dba769cc7a1f2 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Tue, 16 Jan 2001 18:33:05 +0000 Subject: Set the tdb->map_ptr to NULL if mmap() returns -1. (This used to be commit cef7f58ac5cc0c96e1027c7e5ecbb3fb72cb94b6) --- source3/tdb/tdb.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3') 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; } -- cgit