projects
/
idzebra-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5d24843
)
Avoid abort. EXTRA_CHECK defined and annotated
author
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 14 Nov 2006 12:11:48 +0000
(12:11 +0000)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 14 Nov 2006 12:11:48 +0000
(12:11 +0000)
bfile/cfile.c
patch
|
blob
|
history
diff --git
a/bfile/cfile.c
b/bfile/cfile.c
index
4774072
..
a0dfaa2
100644
(file)
--- a/
bfile/cfile.c
+++ b/
bfile/cfile.c
@@
-1,4
+1,4
@@
-/* $Id: cfile.c,v 1.39 2006-11-14 08:12:06 adam Exp $
+/* $Id: cfile.c,v 1.40 2006-11-14 12:11:48 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
Copyright (C) 1995-2006
Index Data ApS
@@
-29,6
+29,9
@@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "mfile.h"
#include "cfile.h"
#include "mfile.h"
#include "cfile.h"
+/* set to 1 if extra commit/shadow check is to be performed */
+#define EXTRA_CHECK 0
+
static int write_head(CFile cf)
{
int left = cf->head.hash_size * sizeof(zint);
static int write_head(CFile cf)
{
int left = cf->head.hash_size * sizeof(zint);
@@
-343,20
+346,19
@@
static int cf_lookup_hash(CFile cf, zint no, zint *vno)
}
if (hb)
continue;
}
if (hb)
continue;
-#if 0
- /* extra check ... */
+#if EXTRA_CHECK
for (hb = cf->bucket_lru_back; hb; hb = hb->lru_next)
{
if (hb->ph.this_bucket == block_no)
{
yaz_log(YLOG_FATAL, "Found hash bucket on other chain(1)");
for (hb = cf->bucket_lru_back; hb; hb = hb->lru_next)
{
if (hb->ph.this_bucket == block_no)
{
yaz_log(YLOG_FATAL, "Found hash bucket on other chain(1)");
- abort();
+ return -1;
}
for (i = 0; i<HASH_BUCKET && hb->ph.vno[i]; i++)
if (hb->ph.no[i] == no)
{
yaz_log(YLOG_FATAL, "Found hash bucket on other chain (2)");
}
for (i = 0; i<HASH_BUCKET && hb->ph.vno[i]; i++)
if (hb->ph.no[i] == no)
{
yaz_log(YLOG_FATAL, "Found hash bucket on other chain (2)");
- abort();
+ return -1;
}
}
#endif
}
}
#endif
@@
-476,14
+478,13
@@
static zint cf_new_hash(CFile cf, zint no)
if (hb)
continue;
if (hb)
continue;
-#if 0
- /* extra check ... */
+#if EXTRA_CHECK
for (hb = cf->bucket_lru_back; hb; hb = hb->lru_next)
{
if (hb->ph.this_bucket == *bucketpp)
{
yaz_log(YLOG_FATAL, "Found hash bucket on other chain");
for (hb = cf->bucket_lru_back; hb; hb = hb->lru_next)
{
if (hb->ph.this_bucket == *bucketpp)
{
yaz_log(YLOG_FATAL, "Found hash bucket on other chain");
- abort();
+ return 0;
}
}
#endif
}
}
#endif