]> arthur.barton.de Git - netatalk.git/commitdiff
Index check and rebuild, only count the didname index if the devino index is ok.
authordidg <didg>
Mon, 3 Jan 2005 13:49:55 +0000 (13:49 +0000)
committerdidg <didg>
Mon, 3 Jan 2005 13:49:55 +0000 (13:49 +0000)
bin/cnid/cnid_index.c
etc/cnid_dbd/dbd_dbcheck.c

index 08328d564fce9ef36f4ac33c170a4989e4582fa6..b265229c44fbc7d7ce7b527a23cdbd3e1c39c005 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: cnid_index.c,v 1.1.2.1 2004-12-21 13:36:11 didg Exp $
+ * $Id: cnid_index.c,v 1.1.2.2 2005-01-03 13:49:55 didg Exp $
  *
  * All Rights Reserved.  See COPYING.
  */
@@ -300,15 +300,18 @@ static int dbd_check(char *dbdir)
     if (dbif_count(DBIF_IDX_DIDNAME, &c_didname)) 
         return -1;
     
-    /* bailout after the first error */
     if (dbif_count(DBIF_IDX_DEVINO, &c_devino))
         return -1;
 
+    /* bailout after the first error */
     if ( c_cnid != c_devino) {
         LOG(log_error, logtype_cnid, "CNID database at `%s' corrupted (%u/%u)", dbdir, c_cnid, c_devino);
         return 1;
     }
 
+    if (dbif_count(DBIF_IDX_DIDNAME, &c_didname)) 
+        return -1;
+
     if ( c_cnid != c_didname) {
         LOG(log_error, logtype_cnid, "CNID database at `%s' corrupted (%u/%u)", dbdir, c_cnid, c_didname);
         return 1;
index 652bf2dd1db3376bd94e2cc4ba3a5c1a49e52e6c..58d06e7d44b21ca40d4c396368d5982512953943 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: dbd_dbcheck.c,v 1.1.2.1 2004-12-21 13:36:12 didg Exp $
+ * $Id: dbd_dbcheck.c,v 1.1.2.2 2005-01-03 13:49:56 didg Exp $
  *
  * Copyright (C) Joerg Lenneis 2003
  * All Rights Reserved.  See COPYING.
@@ -37,18 +37,18 @@ int dbd_check(char *dbdir)
     if (dbif_count(DBIF_IDX_CNID, &c_cnid)) 
         return -1;
 
-    if (dbif_count(DBIF_IDX_DIDNAME, &c_didname)) 
-        return -1;
-    
-    /* bailout after the first error */
     if (dbif_count(DBIF_IDX_DEVINO, &c_devino))
         return -1;
 
+    /* bailout after the first error */
     if ( c_cnid != c_devino) {
         LOG(log_error, logtype_cnid, "CNID database at `%s' corrupted (%u/%u)", dbdir, c_cnid, c_devino);
         return 1;
     }
 
+    if (dbif_count(DBIF_IDX_DIDNAME, &c_didname)) 
+        return -1;
+    
     if ( c_cnid != c_didname) {
         LOG(log_error, logtype_cnid, "CNID database at `%s' corrupted (%u/%u)", dbdir, c_cnid, c_didname);
         return 1;