Fixed bug with numerical relations.
[idzebra-moved-to-github.git] / index / lockidx.c
index 30bc6d0..730a2bf 100644 (file)
@@ -1,10 +1,16 @@
 /*
- * Copyright (C) 1994-1995, Index Data I/S 
+ * Copyright (C) 1994-1998, Index Data I/S 
  * All rights reserved.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: lockidx.c,v $
- * Revision 1.13  1997-09-29 09:08:36  adam
+ * Revision 1.15  1998-02-17 10:31:33  adam
+ * Fixed bug in zebraIndexUnlock. On NT, the lock files wasn't removed.
+ *
+ * Revision 1.14  1998/01/12 15:04:08  adam
+ * The test option (-s) only uses read-lock (and not write lock).
+ *
+ * Revision 1.13  1997/09/29 09:08:36  adam
  * Revised locking system to be thread safe for the server.
  *
  * Revision 1.12  1997/09/25 14:54:43  adam
@@ -157,9 +163,11 @@ void zebraIndexUnlock (void)
 {
     char path[1024];
     
+    zebra_lock_destroy (server_lock_main);
     zebra_lock_prefix (common_resource, path);
     strcat (path, FNAME_MAIN_LOCK);
-    unlink (path);
+    if (unlink (path))
+        logf (LOG_WARN|LOG_ERRNO, "unlink %s", path);
 }
 
 void zebraIndexLock (BFiles bfs, int commitNow, const char *rval)
@@ -247,7 +255,12 @@ void zebraIndexLock (BFiles bfs, int commitNow, const char *rval)
                 }                    
                 else if (*buf == 'w')
                 {
-                    logf (LOG_WARN, "your index may be inconsistent");
+                   logf (LOG_WARN,
+                         "The lock file indicates that your index is");
+                   logf (LOG_WARN, "inconsistent. Perhaps the indexer");
+                   logf (LOG_WARN, "terminated abnormally in the previous");
+                   logf (LOG_WARN, "run. You can try to proceed by");
+                   logf (LOG_WARN, "deleting the file %s", path);
                     exit (1);
                 }
                 else if (*buf == 'c')