svn commit: samba r22041 - in branches/SAMBA_4_0/source/lib/tdb: common include

metze at samba.org metze at samba.org
Mon Apr 2 18:56:25 GMT 2007


Author: metze
Date: 2007-04-02 18:56:25 +0000 (Mon, 02 Apr 2007)
New Revision: 22041

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22041

Log:
merge trivial changes from samba3

metze
Modified:
   branches/SAMBA_4_0/source/lib/tdb/common/freelistcheck.c
   branches/SAMBA_4_0/source/lib/tdb/common/io.c
   branches/SAMBA_4_0/source/lib/tdb/common/open.c
   branches/SAMBA_4_0/source/lib/tdb/common/tdb.c
   branches/SAMBA_4_0/source/lib/tdb/common/transaction.c
   branches/SAMBA_4_0/source/lib/tdb/include/tdb.h


Changeset:
Modified: branches/SAMBA_4_0/source/lib/tdb/common/freelistcheck.c
===================================================================
--- branches/SAMBA_4_0/source/lib/tdb/common/freelistcheck.c	2007-04-02 18:43:31 UTC (rev 22040)
+++ branches/SAMBA_4_0/source/lib/tdb/common/freelistcheck.c	2007-04-02 18:56:25 UTC (rev 22041)
@@ -39,7 +39,7 @@
 	TDB_DATA key, data;
 
 	memset(&data, '\0', sizeof(data));
-	key.dptr = (char *)&rec_ptr;
+	key.dptr = (unsigned char *)&rec_ptr;
 	key.dsize = sizeof(rec_ptr);
 	return tdb_store(mem_tdb, key, data, TDB_INSERT);
 }

Modified: branches/SAMBA_4_0/source/lib/tdb/common/io.c
===================================================================
--- branches/SAMBA_4_0/source/lib/tdb/common/io.c	2007-04-02 18:43:31 UTC (rev 22040)
+++ branches/SAMBA_4_0/source/lib/tdb/common/io.c	2007-04-02 18:56:25 UTC (rev 22041)
@@ -124,8 +124,10 @@
 		if (ret != (ssize_t)len) {
 			/* Ensure ecode is set for log fn. */
 			tdb->ecode = TDB_ERR_IO;
-			TDB_LOG((tdb, TDB_DEBUG_FATAL,"tdb_read failed at %d len=%d ret=%d (%s) map_size=%d\n",
-				 off, len, ret, strerror(errno), (int)tdb->map_size));
+			TDB_LOG((tdb, TDB_DEBUG_FATAL,"tdb_read failed at %d "
+				 "len=%d ret=%d (%s) map_size=%d\n",
+				 (int)off, (int)len, (int)ret, strerror(errno),
+				 (int)tdb->map_size));
 			return TDB_ERRCODE(TDB_ERR_IO, -1);
 		}
 	}
@@ -339,7 +341,7 @@
 		len = 1;
 	}
 
-	if (!(buf = malloc(len))) {
+	if (!(buf = (unsigned char *)malloc(len))) {
 		/* Ensure ecode is set for log fn. */
 		tdb->ecode = TDB_ERR_OOM;
 		TDB_LOG((tdb, TDB_DEBUG_ERROR,"tdb_alloc_read malloc failed len=%d (%s)\n",

Modified: branches/SAMBA_4_0/source/lib/tdb/common/open.c
===================================================================
--- branches/SAMBA_4_0/source/lib/tdb/common/open.c	2007-04-02 18:43:31 UTC (rev 22040)
+++ branches/SAMBA_4_0/source/lib/tdb/common/open.c	2007-04-02 18:56:25 UTC (rev 22041)
@@ -372,9 +372,9 @@
 
 /* register a loging function */
 void tdb_set_logging_function(struct tdb_context *tdb,
-                              const struct tdb_logging_context *log)
+                              const struct tdb_logging_context *log_ctx)
 {
-        tdb->log = *log;
+        tdb->log = *log_ctx;
 }
 
 void *tdb_get_logging_private(struct tdb_context *tdb)

Modified: branches/SAMBA_4_0/source/lib/tdb/common/tdb.c
===================================================================
--- branches/SAMBA_4_0/source/lib/tdb/common/tdb.c	2007-04-02 18:43:31 UTC (rev 22040)
+++ branches/SAMBA_4_0/source/lib/tdb/common/tdb.c	2007-04-02 18:56:25 UTC (rev 22041)
@@ -564,9 +564,10 @@
 	dbuf = tdb_fetch(tdb, key);
 
 	if (dbuf.dptr == NULL) {
-		dbuf.dptr = malloc(new_dbuf.dsize);
+		dbuf.dptr = (unsigned char *)malloc(new_dbuf.dsize);
 	} else {
-		dbuf.dptr = realloc(dbuf.dptr, dbuf.dsize + new_dbuf.dsize);
+		dbuf.dptr = (unsigned char *)realloc(dbuf.dptr,
+						     dbuf.dsize + new_dbuf.dsize);
 	}
 
 	if (dbuf.dptr == NULL) {

Modified: branches/SAMBA_4_0/source/lib/tdb/common/transaction.c
===================================================================
--- branches/SAMBA_4_0/source/lib/tdb/common/transaction.c	2007-04-02 18:43:31 UTC (rev 22040)
+++ branches/SAMBA_4_0/source/lib/tdb/common/transaction.c	2007-04-02 18:56:25 UTC (rev 22041)
@@ -39,7 +39,7 @@
     by the header. This removes the need for extra journal files as
     used by some other databases
 
-  - dymacially allocated the transaction recover record, re-using it
+  - dynamically allocated the transaction recover record, re-using it
     for subsequent transactions. If a larger record is needed then
     tdb_free() the old record to place it on the normal tdb freelist
     before allocating the new record
@@ -88,6 +88,12 @@
 
 */
 
+struct tdb_transaction_el {
+	struct tdb_transaction_el *next, *prev;
+	tdb_off_t offset;
+	tdb_len_t length;
+	unsigned char *data;
+};
 
 /*
   hold the context of any current transaction
@@ -105,12 +111,7 @@
 	   ordered, with first element at the front of the list. It
 	   needs to be doubly linked as the read/write traversals need
 	   to be backwards, while the commit needs to be forwards */
-	struct tdb_transaction_el {
-		struct tdb_transaction_el *next, *prev;
-		tdb_off_t offset;
-		tdb_len_t length;
-		unsigned char *data;
-	} *elements, *elements_last;
+	struct tdb_transaction_el *elements, *elements_last;
 
 	/* non-zero when an internal transaction error has
 	   occurred. All write operations will then fail until the

Modified: branches/SAMBA_4_0/source/lib/tdb/include/tdb.h
===================================================================
--- branches/SAMBA_4_0/source/lib/tdb/include/tdb.h	2007-04-02 18:43:31 UTC (rev 22040)
+++ branches/SAMBA_4_0/source/lib/tdb/include/tdb.h	2007-04-02 18:56:25 UTC (rev 22041)
@@ -98,7 +98,7 @@
 
 int tdb_reopen(struct tdb_context *tdb);
 int tdb_reopen_all(int parent_longlived);
-void tdb_set_logging_function(struct tdb_context *tdb, const struct tdb_logging_context *log);
+void tdb_set_logging_function(struct tdb_context *tdb, const struct tdb_logging_context *log_ctx);
 enum TDB_ERROR tdb_error(struct tdb_context *tdb);
 const char *tdb_errorstr(struct tdb_context *tdb);
 TDB_DATA tdb_fetch(struct tdb_context *tdb, TDB_DATA key);



More information about the samba-cvs mailing list