]> arthur.barton.de Git - netatalk.git/commitdiff
dbif_del was called with DBIF_IDX_DEVINO/DBIF_IDX_DIDNAME
authorlenneis <lenneis>
Wed, 3 Dec 2003 00:40:20 +0000 (00:40 +0000)
committerlenneis <lenneis>
Wed, 3 Dec 2003 00:40:20 +0000 (00:40 +0000)
as opposed to DBIF_IDX_CNID in dbd_update.

etc/cnid_dbd/dbd_update.c

index f5cd389309ca5f6faaafcba17f425e929953bbae..74c0a407fa08362abbefbbe394df5030130b6ffe 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: dbd_update.c,v 1.1.4.5 2003-11-25 00:41:31 lenneis Exp $
+ * $Id: dbd_update.c,v 1.1.4.6 2003-12-03 00:40:20 lenneis Exp $
  *
  * Copyright (C) Joerg Lenneis 2003
  * All Rights Reserved.  See COPYRIGHT.
 
 /* cnid_update: takes the given cnid and updates the metadata. */
 
+/* FIXME: This calls pack_cnid_data(rqst) three times without modifying rqst */
+/* FIXME: (Only tested with DB 4.1.25):
+
+      dbif_pget on the secondary index followed by dbif_del with the CNID on the
+      main cnid db could be replaced by a single dbif_del on the secondary index. That 
+      deletes the secondary, the corresponding entry from the main cnid db as well as the 
+      other secondary index.
+*/   
+   
 int dbd_update(struct cnid_dbd_rqst *rqst, struct cnid_dbd_rply *rply)
 {
     DBT key,pkey, data;
@@ -47,8 +56,7 @@ int dbd_update(struct cnid_dbd_rqst *rqst, struct cnid_dbd_rply *rply)
         goto err_db;
     }
     else if  (rc > 0) { 
-       /* FIXME: pkey.data points to the CNID? */
-        if ((rc = dbif_del(DBIF_IDX_DEVINO, &pkey, 0)) < 0 ) {
+        if ((rc = dbif_del(DBIF_IDX_CNID, &pkey, 0)) < 0 ) {
             goto err_db;
         }
     }
@@ -65,8 +73,7 @@ int dbd_update(struct cnid_dbd_rqst *rqst, struct cnid_dbd_rply *rply)
         goto err_db;
     }
     else if  (rc > 0) {
-       /* FIXME: pkey.data points to the CNID? */
-        if ((rc = dbif_del(DBIF_IDX_DIDNAME, &pkey, 0)) < 0) {
+        if ((rc = dbif_del(DBIF_IDX_CNID, &pkey, 0)) < 0) {
             goto err_db;
         }
     }