TDB on OpenBSD problem.

Jeremy Allison jeremy at valinux.com
Fri May 4 20:40:13 GMT 2001


Ok - can people on OpenBSD and HPUX 10.0 please try the following patch
to tdb.c to see if it fixes the problem.

Thanks,

		Jeremy Allison,
		Samba Team.

Index: tdb/tdb.c
===================================================================
RCS file: /data/cvs/samba/source/tdb/tdb.c,v
retrieving revision 1.53
diff -u -r1.53 tdb.c
--- tdb/tdb.c	2001/04/14 00:41:15	1.53
+++ tdb/tdb.c	2001/05/04 20:35:54
@@ -439,14 +439,14 @@
            the database up to a multiple of TDB_PAGE_SIZE */
 	size = TDB_ALIGN(tdb->map_size + size*10, TDB_PAGE_SIZE) - tdb->map_size;
 
+	if (!(tdb->flags & TDB_INTERNAL) && tdb->map_ptr)
+		tdb->map_ptr = tdb_munmap(tdb->map_ptr, tdb->map_size);
+
 	/* expand the file itself */
-        if (!(tdb->flags & TDB_INTERNAL)) {
+	if (!(tdb->flags & TDB_INTERNAL)) {
 		lseek(tdb->fd, tdb->map_size + size - 1, SEEK_SET);
 		if (write(tdb->fd, &b, 1) != 1) goto fail;
-        }
-
-	if (!(tdb->flags & TDB_INTERNAL) && tdb->map_ptr)
-		tdb->map_ptr = tdb_munmap(tdb->map_ptr, tdb->map_size);
+	}
 
 	tdb->map_size += size;
 
-- 
--------------------------------------------------------
Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.
--------------------------------------------------------




More information about the samba-technical mailing list