From 7d4f4b37e1fb629e3fb04362394973c8aa01ef6c Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Sun, 18 Aug 2002 10:20:35 +0000 Subject: [PATCH] Graceful error (2) if lock files cannot be accessed --- index/zebraapi.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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'; -- 1.7.10.4