From: Adam Dickmeiss Date: Sun, 18 Aug 2002 10:20:35 +0000 (+0000) Subject: Graceful error (2) if lock files cannot be accessed X-Git-Tag: ZEBRA.1.3.1~3 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=7d4f4b37e1fb629e3fb04362394973c8aa01ef6c;p=idzebra-moved-to-github.git Graceful error (2) if lock files cannot be accessed --- diff --git a/index/zebraapi.c b/index/zebraapi.c index 0633fd0..dc0913f 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -1,4 +1,4 @@ -/* $Id: zebraapi.c,v 1.66 2002-08-05 19:46:01 adam Exp $ +/* $Id: zebraapi.c,v 1.67 2002-08-18 10:20:35 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -694,6 +694,11 @@ int zebra_select_databases (ZebraHandle zh, int num_bases, zh->errCode = 109; return -1; } + if (!zh->lock_normal || !zh->lock_shadow) + { + zh->errCode = 2; + return -1; + } return 0; } @@ -1008,6 +1013,12 @@ int zebra_begin_read (ZebraHandle zh) zh->errCode = 109; return -1; } + if (!zh->lock_normal || !zh->lock_shadow) + { + (zh->trans_no)--; + zh->errCode = 2; + return -1; + } zebra_get_state (zh, &val, &seqno); if (val == 'd') val = 'o';