svn commit: samba r23751 - in branches: SAMBA_3_0/source/lib SAMBA_3_0_26/source/lib

obnox at samba.org obnox at samba.org
Sun Jul 8 22:01:44 GMT 2007


Author: obnox
Date: 2007-07-08 22:01:43 +0000 (Sun, 08 Jul 2007)
New Revision: 23751

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

Log:
Call tdb_close even when validation was not successful.

Michael


Modified:
   branches/SAMBA_3_0/source/lib/util_tdb.c
   branches/SAMBA_3_0_26/source/lib/util_tdb.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/util_tdb.c
===================================================================
--- branches/SAMBA_3_0/source/lib/util_tdb.c	2007-07-07 23:57:25 UTC (rev 23750)
+++ branches/SAMBA_3_0/source/lib/util_tdb.c	2007-07-08 22:01:43 UTC (rev 23751)
@@ -994,7 +994,6 @@
 			      int pfd)
 {
 	int ret = -1;
-	int tfd = -1;
 	int num_entries = 0;
 	TDB_CONTEXT *tdb = NULL;
 	struct tdb_validation_status v_status;
@@ -1012,8 +1011,6 @@
 		goto out;
 	}
 
-	tfd = tdb_fd(tdb);
-
 	/* Check the cache freelist is good. */
 	if (tdb_validate_freelist(tdb, &num_entries) == -1) {
 		DEBUG(0,("tdb_validate_child: bad freelist in cache %s\n",
@@ -1048,12 +1045,7 @@
 
 out:
 	if (tdb) {
-		if (ret == 0) {
-			tdb_close(tdb);
-		}
-		else if (tfd != -1) {
-			close(tfd);
-		}
+		tdb_close(tdb);
 	}
 
 	DEBUG(10, ("tdb_validate_child: writing status to pipe\n"));

Modified: branches/SAMBA_3_0_26/source/lib/util_tdb.c
===================================================================
--- branches/SAMBA_3_0_26/source/lib/util_tdb.c	2007-07-07 23:57:25 UTC (rev 23750)
+++ branches/SAMBA_3_0_26/source/lib/util_tdb.c	2007-07-08 22:01:43 UTC (rev 23751)
@@ -994,7 +994,6 @@
 			      int pfd)
 {
 	int ret = -1;
-	int tfd = -1;
 	int num_entries = 0;
 	TDB_CONTEXT *tdb = NULL;
 	struct tdb_validation_status v_status;
@@ -1012,8 +1011,6 @@
 		goto out;
 	}
 
-	tfd = tdb_fd(tdb);
-
 	/* Check the cache freelist is good. */
 	if (tdb_validate_freelist(tdb, &num_entries) == -1) {
 		DEBUG(0,("tdb_validate_child: bad freelist in cache %s\n",
@@ -1048,12 +1045,7 @@
 
 out:
 	if (tdb) {
-		if (ret == 0) {
-			tdb_close(tdb);
-		}
-		else if (tfd != -1) {
-			close(tfd);
-		}
+		tdb_close(tdb);
 	}
 
 	DEBUG(10, ("tdb_validate_child: writing status to pipe\n"));



More information about the samba-cvs mailing list