svn commit: samba r6592 - in branches/SAMBA_4_0/source/scripting/swig: .

tpot at samba.org tpot at samba.org
Tue May 3 07:10:47 GMT 2005


Author: tpot
Date: 2005-05-03 07:10:46 +0000 (Tue, 03 May 2005)
New Revision: 6592

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

Log:
Throw an IOError exception if tdb_open() or tdb_open_Ex() returns NULL.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/tdb.i


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/tdb.i
===================================================================
--- branches/SAMBA_4_0/source/scripting/swig/tdb.i	2005-05-03 06:11:12 UTC (rev 6591)
+++ branches/SAMBA_4_0/source/scripting/swig/tdb.i	2005-05-03 07:10:46 UTC (rev 6592)
@@ -103,6 +103,16 @@
 #define TDB_CONVERT 16 /* convert endian (internal use) */
 #define TDB_BIGENDIAN 32 /* header is big-endian (internal use) */
 
+/* Throw an IOError exception if tdb_open() or tdb_open_ex() returns NULL */
+
+%exception {
+	$action
+	if (result == NULL) {
+		PyErr_SetFromErrno(PyExc_IOError);
+		SWIG_fail;
+	}
+}
+
 %rename tdb_open open;
 TDB_CONTEXT *tdb_open(const char *name, int hash_size, int tdb_flags,
 		      int open_flags, mode_t mode);
@@ -113,6 +123,8 @@
 			 tdb_log_func log_fn,
 			 tdb_hash_func hash_fn);
 
+%exception;
+
 %rename tdb_reopen reopen;
 int tdb_reopen(TDB_CONTEXT *tdb);
 



More information about the samba-cvs mailing list