Fixed bug #454: Indexing with grs.regx much slower than version 1.3.32.
[idzebra-moved-to-github.git] / util / flock.c
index 66f2709..cae9fb1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: flock.c,v 1.4 2006-03-24 13:33:57 adam Exp $
+/* $Id: flock.c,v 1.7 2006-05-10 08:13:46 adam Exp $
    Copyright (C) 1995-2005
    Index Data ApS
 
@@ -44,7 +44,7 @@ struct zebra_lock_info {
     char *fname;
 };
 
-int log_level = 0 /* YLOG_LOG|YLOG_FLUSH */;
+static int log_level = 0 /* YLOG_LOG|YLOG_FLUSH */;
 
 char *zebra_mk_fname (const char *dir, const char *name)
 {
@@ -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);
@@ -162,3 +163,11 @@ int zebra_unlock (ZebraLockHandle h)
 #endif
 }
 
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+