s3:dbwrap_ctdb: re-use map_nt_error_from_tdb() in local tdb_error_to_ntstatus()
authorMichael Adam <obnox@samba.org>
Tue, 29 Nov 2011 14:57:10 +0000 (15:57 +0100)
committerMichael Adam <obnox@samba.org>
Tue, 29 Nov 2011 17:20:06 +0000 (18:20 +0100)
source3/lib/dbwrap/dbwrap_ctdb.c

index aae5c065f658ab3131fadc8244ae488f05c5786e..234aeebae33289154247505c2357f27e7cfd4131 100644 (file)
@@ -82,22 +82,9 @@ struct db_ctdb_rec {
 
 static NTSTATUS tdb_error_to_ntstatus(struct tdb_context *tdb)
 {
-       NTSTATUS status;
        enum TDB_ERROR tret = tdb_error(tdb);
 
-       switch (tret) {
-       case TDB_ERR_EXISTS:
-               status = NT_STATUS_OBJECT_NAME_COLLISION;
-               break;
-       case TDB_ERR_NOEXIST:
-               status = NT_STATUS_OBJECT_NAME_NOT_FOUND;
-               break;
-       default:
-               status = NT_STATUS_INTERNAL_DB_CORRUPTION;
-               break;
-       }
-
-       return status;
+       return map_nt_error_from_tdb(tret);
 }