Use HAVE_UNISTD_H when including unistd.h.
[idzebra-moved-to-github.git] / bfile / mfile.c
index 69a062a..ce4279a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: mfile.c,v 1.59 2005-03-30 09:25:23 adam Exp $
+/* $Id: mfile.c,v 1.62 2005-06-14 20:28:53 adam Exp $
    Copyright (C) 1995-2005
    Index Data ApS
 
@@ -32,7 +32,8 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include <fcntl.h>
 #ifdef WIN32
 #include <io.h>
-#else
+#endif
+#if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 #include <direntz.h>
@@ -44,6 +45,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include <zebra-lock.h>
 #include <idzebra/util.h>
+#include <yaz/yaz-util.h>
 #include "mfile.h"
 
 static int scan_areadef(MFile_area ma, const char *ad, const char *base)
@@ -160,7 +162,7 @@ static zint file_position(MFile mf, zint pos, int offset)
             if (!mf->wr && errno == ENOENT && off == 0)
                 return -2;
            yaz_log (YLOG_WARN|YLOG_ERRNO, "Failed to open %s", mf->files[c].path);
-            return -1;
+           return -1;
         }
     }
     ps = pos - off;