X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=bfile%2Fmfile.c;h=73c55deba63838aee4ed0bf7549d92500bac91f0;hb=e6c40598be6d20486d0c17fa115af66b9ee54d07;hp=dfbfadd9b46ccd3027d6c9c9d699aa2becb31c5d;hpb=08b7c1004e499046730ef564c901cc3b584d6e1f;p=idzebra-moved-to-github.git diff --git a/bfile/mfile.c b/bfile/mfile.c index dfbfadd..73c55de 100644 --- a/bfile/mfile.c +++ b/bfile/mfile.c @@ -1,8 +1,5 @@ -/* $Id: mfile.c,v 1.72 2006-12-03 16:05:13 adam Exp $ - Copyright (C) 1995-2006 - Index Data ApS - -This file is part of the Zebra server. +/* This file is part of the Zebra server. + Copyright (C) 1994-2011 Index Data Zebra is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -288,9 +285,6 @@ MFile_area mf_init(const char *name, const char *spec, const char *base, mf_destroy(ma); return 0; } -#ifndef WIN32 - fsync(fd); -#endif close(fd); if (dirp->max_bytes >= 0) dirp->avail_bytes -= part_f->bytes; @@ -369,6 +363,7 @@ MFile mf_open(MFile_area ma, const char *name, int block_size, int wflag) yaz_log(YLOG_WARN, "metafile %s already open", name); return 0; } + break; } if (!mnew) { @@ -439,7 +434,8 @@ int mf_close(MFile mf) if (mf->files[i].fd >= 0) { #ifndef WIN32 - fsync(mf->files[i].fd); + if (mf->wr) + fsync(mf->files[i].fd); #endif close(mf->files[i].fd); mf->files[i].fd = -1; @@ -544,6 +540,13 @@ int mf_write(MFile mf, zint no, int offset, int nbytes, const void *buf) { yaz_log(YLOG_FATAL, "mf_write: %s error (4) no more space", mf->name); + for (dp = mf->ma->dirs; dp ; dp = dp->next) { + yaz_log(YLOG_FATAL,"%s: max=" ZINT_FORMAT + " used=" ZINT_FORMAT " available=" ZINT_FORMAT, + dp->name, (zint)dp->max_bytes, + (zint)(dp->max_bytes - dp->avail_bytes), (zint)dp->avail_bytes ); + } + yaz_log(YLOG_FATAL,"Adjust the limits in your zebra.cfg"); ret = -1; goto out; } @@ -626,6 +629,7 @@ int mf_area_directory_stat(MFile_area ma, int no, const char **directory, /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab