projects
/
idzebra-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added call to xmalloc/nmem debugging functions.
[idzebra-moved-to-github.git]
/
index
/
lockidx.c
diff --git
a/index/lockidx.c
b/index/lockidx.c
index
cd2583f
..
7adf2eb
100644
(file)
--- a/
index/lockidx.c
+++ b/
index/lockidx.c
@@
-4,7
+4,13
@@
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: lockidx.c,v $
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: lockidx.c,v $
- * Revision 1.16 1999-02-02 14:50:57 adam
+ * Revision 1.18 2000-02-24 11:00:07 adam
+ * Fixed bug: indexer would run forever when lock dir was non-existant.
+ *
+ * Revision 1.17 1999/12/08 15:03:11 adam
+ * Implemented bf_reset.
+ *
+ * Revision 1.16 1999/02/02 14:50:57 adam
* Updated WIN32 code specific sections. Changed header.
*
* Revision 1.15 1998/02/17 10:31:33 adam
* Updated WIN32 code specific sections. Changed header.
*
* Revision 1.15 1998/02/17 10:31:33 adam
@@
-167,20
+173,21
@@
void zebraIndexUnlock (void)
char path[1024];
zebra_lock_destroy (server_lock_main);
char path[1024];
zebra_lock_destroy (server_lock_main);
+ server_lock_main = 0;
zebra_lock_prefix (common_resource, path);
strcat (path, FNAME_MAIN_LOCK);
zebra_lock_prefix (common_resource, path);
strcat (path, FNAME_MAIN_LOCK);
- if (unlink (path))
- logf (LOG_WARN|LOG_ERRNO, "unlink %s", path);
+ if (unlink (path) && errno != ENOENT)
+ logf (LOG_WARN|LOG_ERRNO, "unlink %s failed", path);
}
}
-void zebraIndexLock (BFiles bfs, int commitNow, const char *rval)
+int zebraIndexLock (BFiles bfs, int commitNow, const char *rval)
{
char path[1024];
char buf[256];
int r;
if (server_lock_main)
{
char path[1024];
char buf[256];
int r;
if (server_lock_main)
- return ;
+ return 0;
zebra_lock_prefix (common_resource, path);
strcat (path, FNAME_MAIN_LOCK);
zebra_lock_prefix (common_resource, path);
strcat (path, FNAME_MAIN_LOCK);
@@
-192,10
+199,8
@@
void zebraIndexLock (BFiles bfs, int commitNow, const char *rval)
server_lock_main = zebra_lock_create (path, 1);
if (!server_lock_main)
{
server_lock_main = zebra_lock_create (path, 1);
if (!server_lock_main)
{
- if (errno == ENOENT)
- continue;
- logf (LOG_FATAL|LOG_ERRNO, "open %s", path);
- exit (1);
+ logf (LOG_FATAL, "couldn't obtain indexer lock");
+ exit (1);
}
if (zebra_lock_nb (server_lock_main) == -1)
{
}
if (zebra_lock_nb (server_lock_main) == -1)
{
@@
-290,5
+295,6
@@
void zebraIndexLock (BFiles bfs, int commitNow, const char *rval)
break;
}
zebra_lock (server_lock_main);
break;
}
zebra_lock (server_lock_main);
+ return 0;
}
}