From 54da2f13bc20e4369757453575668339c8dfd9fd Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 29 Aug 2002 08:47:08 +0000 Subject: [PATCH] Fix log messages --- index/extract.c | 9 ++++++--- index/main.c | 8 ++++++-- index/zebraapi.c | 6 ++---- index/zserver.c | 4 ++-- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/index/extract.c b/index/extract.c index 3138c88..7bb00b7 100644 --- a/index/extract.c +++ b/index/extract.c @@ -1,4 +1,4 @@ -/* $Id: extract.c,v 1.121 2002-08-28 12:47:10 adam Exp $ +/* $Id: extract.c,v 1.122 2002-08-29 08:47:08 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -40,6 +40,9 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #define PRINTF_OFF_T "%ld" #endif +#define USE_SHELLSORT 0 + +#if USE_SHELLSORT static void shellsort(void *ar, int r, size_t s, int (*cmp)(const void *a, const void *b)) { @@ -62,7 +65,7 @@ static void shellsort(void *ar, int r, size_t s, memcpy (a+s*j, v, s); } } - +#endif static void logRecord (ZebraHandle zh) { @@ -419,7 +422,7 @@ static void recordLogPreamble (int level, const char *msg, void *info) if (level & LOG_LOG) return ; fprintf (outf, "File %s, offset %d, type %s\n", - p->rGroup->recordType, p->recordOffset, p->fname); + p->fname, p->recordOffset, p->rGroup->recordType); log_event_start (NULL, NULL); } diff --git a/index/main.c b/index/main.c index bedca40..02101ab 100644 --- a/index/main.c +++ b/index/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.94 2002-08-05 14:08:08 adam Exp $ +/* $Id: main.c,v 1.95 2002-08-29 08:47:08 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -119,11 +119,15 @@ int main (int argc, char **argv) { if (!zs) { + const char *config = configName ? configName : "zebra.cfg"; logf (LOG_LOG, "Zebra version %s %s", ZEBRAVER, ZEBRADATE); - zs = zebra_start (configName ? configName : "zebra.cfg"); + zs = zebra_start (config); if (!zs) + { + yaz_log (LOG_FATAL, "Cannot read config %s", config); exit (1); + } zh = zebra_open (zs); if (disableCommit) zebra_shadow_enable (zh, 0); diff --git a/index/zebraapi.c b/index/zebraapi.c index 26ac712..ae04ebe 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -1,4 +1,4 @@ -/* $Id: zebraapi.c,v 1.68 2002-08-28 19:52:29 adam Exp $ +/* $Id: zebraapi.c,v 1.69 2002-08-29 08:47:08 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -130,9 +130,7 @@ ZebraService zebra_start (const char *configName) yaz_log (LOG_LOG, "zebra_start %s", configName); - if (!(res = res_open (configName, 0))) - yaz_log (LOG_WARN, "Cannot read resources `%s'", configName); - else + if ((res = res_open (configName, 0))) { ZebraService zh = xmalloc (sizeof(*zh)); diff --git a/index/zserver.c b/index/zserver.c index 3c0aae9..dd85fbd 100644 --- a/index/zserver.c +++ b/index/zserver.c @@ -1,4 +1,4 @@ -/* $Id: zserver.c,v 1.91 2002-08-05 14:08:08 adam Exp $ +/* $Id: zserver.c,v 1.92 2002-08-29 08:47:08 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -74,7 +74,7 @@ bend_initresult *bend_init (bend_initrequest *q) sob = statserv_getcontrol (); if (!(zh = zebra_open (sob->handle))) { - yaz_log (LOG_FATAL, "Failed to open config `%s'", sob->configname); + yaz_log (LOG_WARN, "Failed to open config `%s'", sob->configname); r->errcode = 1; return r; } -- 1.7.10.4