svn commit: samba r2240 - in trunk/source/tdb: .

jmcd at samba.org jmcd at samba.org
Tue Sep 7 13:59:32 GMT 2004


Author: jmcd
Date: 2004-09-07 13:59:32 +0000 (Tue, 07 Sep 2004)
New Revision: 2240

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/trunk/source/tdb&rev=2240&nolog=1

Log:
merge from 3.0: fixup TDB_LOG formats and add printf attribute support

Modified:
   trunk/source/tdb/tdb.c
   trunk/source/tdb/tdb.h


Changeset:
Modified: trunk/source/tdb/tdb.c
===================================================================
--- trunk/source/tdb/tdb.c	2004-09-07 13:51:03 UTC (rev 2239)
+++ trunk/source/tdb/tdb.c	2004-09-07 13:59:32 UTC (rev 2240)
@@ -276,7 +276,7 @@
 	if (tdb->locked[list+1].count == 0) {
 		if (!tdb->read_only && tdb->header.rwlocks) {
 			if (tdb_spinlock(tdb, list, ltype)) {
-				TDB_LOG((tdb, 0, "tdb_lock spinlock failed on list ltype=%d\n", 
+				TDB_LOG((tdb, 0, "tdb_lock spinlock failed on list %d ltype=%d\n", 
 					   list, ltype));
 				return -1;
 			}

Modified: trunk/source/tdb/tdb.h
===================================================================
--- trunk/source/tdb/tdb.h	2004-09-07 13:51:03 UTC (rev 2239)
+++ trunk/source/tdb/tdb.h	2004-09-07 13:59:32 UTC (rev 2240)
@@ -31,6 +31,9 @@
 extern "C" {
 #endif
 
+#ifndef PRINTF_ATTRIBUTE
+#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
+#endif
 
 /* flags to tdb_store() */
 #define TDB_REPLACE 1
@@ -101,7 +104,7 @@
 	struct tdb_context *next; /* all tdbs to avoid multiple opens */
 	dev_t device;	/* uniquely identifies this tdb */
 	ino_t inode;	/* uniquely identifies this tdb */
-	void (*log_fn)(struct tdb_context *tdb, int level, const char *, ...); /* logging function */
+	void (*log_fn)(struct tdb_context *tdb, int level, const char *, ...) PRINTF_ATTRIBUTE(3,4); /* logging function */
 	u32 (*hash_fn)(TDB_DATA *key);
 	int open_flags; /* flags used in the open - needed by reopen */
 } TDB_CONTEXT;



More information about the samba-cvs mailing list