From 551ff541dcd53447e07c9ba95d4792bd4fc14d80 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Thu, 13 Apr 2006 12:42:57 +0000 Subject: [PATCH] zebra_lock_create() now logs an error and returns a null pointer if the lock fails, rather then as previously seggy-faulting on a null indirection. This happens if, for example, you do "zebraidx init" using a configuration that asks for the lock-files to be put into a non-existent directory. --- util/flock.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/flock.c b/util/flock.c index e49434e..f91f25b 100644 --- a/util/flock.c +++ b/util/flock.c @@ -1,4 +1,4 @@ -/* $Id: flock.c,v 1.5 2006-03-25 10:06:55 adam Exp $ +/* $Id: flock.c,v 1.6 2006-04-13 12:42:57 mike Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -95,7 +95,8 @@ ZebraLockHandle zebra_lock_create (const char *dir, const char *name) if (h->fd == -1) { xfree (h); - h = 0; + yaz_log(YLOG_WARN | YLOG_ERRNO, "zebra_lock_create fail fname=%s", fname); + return 0; } h->fname = fname; yaz_log(log_level, "zebra_lock_create fd=%d p=%p fname=%s", h->fd, h, h->fname); -- 1.7.10.4