[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Mon Mar 1 06:05:55 MST 2010


The branch, master has been updated
       via  3deba63... s3: Make the difference between r/o and r/w in connections_db_ctx more obvious
      from  c571ecd... s3: Make connections_forall open connections.tdb r/w

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 3deba6349ca751d669e2af817ec7e2c7eb6195b3
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Feb 25 16:31:12 2010 +0100

    s3: Make the difference between r/o and r/w in connections_db_ctx more obvious

-----------------------------------------------------------------------

Summary of changes:
 source3/lib/conn_tdb.c |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/conn_tdb.c b/source3/lib/conn_tdb.c
index 90e455a..e95ada4 100644
--- a/source3/lib/conn_tdb.c
+++ b/source3/lib/conn_tdb.c
@@ -22,21 +22,16 @@
 static struct db_context *connections_db_ctx(bool rw)
 {
 	static struct db_context *db_ctx;
+	int open_flags;
 
 	if (db_ctx != NULL) {
 		return db_ctx;
 	}
 
-	if (rw) {
-		db_ctx = db_open(NULL, lock_path("connections.tdb"), 0,
-				 TDB_CLEAR_IF_FIRST|TDB_DEFAULT, 
-				 O_RDWR | O_CREAT, 0644);
-	}
-	else {
-		db_ctx = db_open(NULL, lock_path("connections.tdb"), 0,
-				 TDB_CLEAR_IF_FIRST|TDB_DEFAULT, O_RDONLY, 0);
-	}
+	open_flags = rw ? (O_RDWR|O_CREAT) : O_RDONLY;
 
+	db_ctx = db_open(NULL, lock_path("connections.tdb"), 0,
+			 TDB_CLEAR_IF_FIRST|TDB_DEFAULT, open_flags, 0644);
 	return db_ctx;
 }
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list