From a4025c597224b522603858f50b0c41658234020b Mon Sep 17 00:00:00 2001
From: lutoff <lutoff@localhost>
Date: Fri, 13 Jul 2007 09:09:26 +0000
Subject: [PATCH] fix for issue #1897 (verif-index , rebuild-index return 0 in case of errors): return code '1' is now returned in case of error. In addition to that, the following argument has been add in order to get the number of errors found by verify-index: "--countErrors" 

---
 opends/src/server/org/opends/server/backends/jeb/BackendImpl.java |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java b/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java
index eae4c00..6e82539 100644
--- a/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java
+++ b/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java
@@ -1185,6 +1185,7 @@
    * Verify the integrity of the backend instance.
    * @param verifyConfig The verify configuration.
    * @param statEntry Optional entry to save stats into.
+   * @return The error count.
    * @throws  ConfigException  If an unrecoverable problem arises during
    *                           initialization.
    * @throws  InitializationException  If a problem occurs during initialization
@@ -1192,12 +1193,13 @@
    *                                   configuration.
    * @throws DirectoryException If a Directory Server error occurs.
    */
-  public void verifyBackend(VerifyConfig verifyConfig, Entry statEntry)
+  public long verifyBackend(VerifyConfig verifyConfig, Entry statEntry)
       throws InitializationException, ConfigException, DirectoryException
   {
     // If the backend already has the root container open, we must use the same
     // underlying root container
     boolean openRootContainer = rootContainer == null;
+    long errorCount = 0 ;
 
     try
     {
@@ -1217,7 +1219,7 @@
       }
 
       VerifyJob verifyJob = new VerifyJob(verifyConfig);
-      verifyJob.verifyBackend(rootContainer, statEntry);
+      errorCount = verifyJob.verifyBackend(rootContainer, statEntry);
     }
     catch (DatabaseException e)
     {
@@ -1260,6 +1262,7 @@
         }
       }
     }
+    return errorCount;
   }
 
 

--
Gitblit v1.10.0