From: Adam Dickmeiss Date: Fri, 4 Jul 2003 13:58:32 +0000 (+0000) Subject: zebra_records_retrieve returns -1 on error; 0 if OK X-Git-Tag: ZEBRA.1.3.12~25 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=4b2532df6fcb883f8eaa41c9514a2dbc94aa0701;p=idzebra-moved-to-github.git zebra_records_retrieve returns -1 on error; 0 if OK --- diff --git a/index/zebraapi.c b/index/zebraapi.c index 31c7a9c..580df6f 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -1,4 +1,4 @@ -/* $Id: zebraapi.c,v 1.109 2003-06-30 19:37:12 adam Exp $ +/* $Id: zebraapi.c,v 1.110 2003-07-04 13:58:32 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003 Index Data Aps @@ -793,7 +793,7 @@ int zebra_records_retrieve (ZebraHandle zh, ODR stream, ZebraRetrievalRecord *recs) { ZebraPosSet poset; - int i, *pos_array; + int i, *pos_array, ret = 0; ASSERTZH; yaz_log(LOG_API,"zebra_records_retrieve n=%d",num_recs); zh->errCode=0; @@ -802,13 +802,13 @@ int zebra_records_retrieve (ZebraHandle zh, ODR stream, { zh->errCode = 30; zh->errString = odr_strdup (stream, setname); - return 1; + return -1; } zh->errCode = 0; if (zebra_begin_read (zh)) - return 1; + return -1; pos_array = (int *) xmalloc (num_recs * sizeof(*pos_array)); for (i = 0; ierrCode = 30; zh->errString = nmem_strdup (stream->mem, setname); + ret = -1; } else { @@ -849,6 +850,7 @@ int zebra_records_retrieve (ZebraHandle zh, ODR stream, sprintf (num_str, "%d", pos_array[i]); zh->errCode = 13; zh->errString = odr_strdup (stream, num_str); + ret = -1; break; } } @@ -856,7 +858,7 @@ int zebra_records_retrieve (ZebraHandle zh, ODR stream, } zebra_end_read (zh); xfree (pos_array); - return 0; + return ret; } int zebra_scan (ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt,