X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=index%2Fmain.c;h=603482013b8ac65997eb194f86287f658dd33446;hb=10d6b6813c5bb9e7b19a12c241ac4e05f5741605;hp=6ccc1f54fd1569d1398d17bff4736491bcab4a94;hpb=ecb3935e78cd9bcfdebafdee0834cfb1060d7b5e;p=idzebra-moved-to-github.git diff --git a/index/main.c b/index/main.c index 6ccc1f5..6034820 100644 --- a/index/main.c +++ b/index/main.c @@ -1,5 +1,5 @@ -/* $Id: main.c,v 1.129 2006-05-10 08:13:22 adam Exp $ - Copyright (C) 1995-2005 +/* $Id: main.c,v 1.131 2006-09-11 22:57:54 adam Exp $ + Copyright (C) 1995-2006 Index Data ApS This file is part of the Zebra server. @@ -15,9 +15,9 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with Zebra; see the file LICENSE.zebra. If not, write to the -Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ #include @@ -231,7 +231,17 @@ int main (int argc, char **argv) } if (res != ZEBRA_OK) { - yaz_log(YLOG_WARN, "Operation failed"); + const char *add = zebra_errAdd(zh); + yaz_log(YLOG_FATAL, "Operation failed: %s %s", + zebra_errString(zh), add ? add : ""); + + if (trans_started) + if (zebra_end_trans (zh) != ZEBRA_OK) + yaz_log (YLOG_WARN, "zebra_end_trans failed"); + + + zebra_close (zh); + zebra_stop (zs); exit(1); } log_event_end (NULL, NULL); @@ -240,7 +250,7 @@ int main (int argc, char **argv) else if (ret == 'V') { printf("Zebra %s %s\n", ZEBRAVER, ZEBRADATE); - printf(" (C) 1994-2005, Index Data ApS\n"); + printf(" (C) 1994-2006, Index Data ApS\n"); #ifdef WIN32 #ifdef _DEBUG printf(" WIN32 Debug\n");