X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=bfile%2Fmfile.c;h=a87ac69c0b87449c94b2beee955f614cb057137b;hb=5f8ba9f35bd3c9aeafe26613021f2edd141b8611;hp=750a3b3efc7822f392be6de0b8f29407fc01949f;hpb=e127268c91736bf5a116cbc24653da4b845ca046;p=idzebra-moved-to-github.git diff --git a/bfile/mfile.c b/bfile/mfile.c index 750a3b3..a87ac69 100644 --- a/bfile/mfile.c +++ b/bfile/mfile.c @@ -4,7 +4,13 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: mfile.c,v $ - * Revision 1.21 1996-10-29 13:56:18 adam + * Revision 1.23 1997-09-09 13:37:53 adam + * Partial port to WIN95/NT. + * + * Revision 1.22 1997/09/04 13:56:39 adam + * Added O_BINARY to open calls. + * + * Revision 1.21 1996/10/29 13:56:18 adam * Include of zebrautl.h instead of alexutil.h. * * Revision 1.20 1996/05/14 12:10:16 quinn @@ -77,8 +83,13 @@ #include #include +#ifdef WINDOWS +#include +#else #include -#include +#endif +#include +#include #include #include #include @@ -188,7 +199,7 @@ static int file_position(MFile mf, int pos, int offset) else off = c ? (mf->files[c-1].top + 1) : 0; if (mf->files[c].fd < 0 && (mf->files[c].fd = open(mf->files[c].path, - mf->wr ? O_RDWR|O_CREAT : O_RDONLY, 0666)) < 0) + mf->wr ? (O_BINARY|O_RDWR|O_CREAT) : (O_BINARY|O_RDONLY), 0666)) < 0) { if (!mf->wr && errno == ENOENT && off == 0) return -2; @@ -286,7 +297,7 @@ MFile_area mf_init(const char *name) sprintf(tmpnam, "%s/%s", dirp->name, dent->d_name); part_f->path = xstrdup(tmpnam); /* get size */ - if ((fd = open(part_f->path, O_RDONLY)) < 0) + if ((fd = open(part_f->path, O_BINARY|O_RDONLY)) < 0) { logf (LOG_FATAL|LOG_ERRNO, "Failed to access %s", dent->d_name);