From bc2ab28dcda97ec8272d6b58ba2e6366ce00c9f1 Mon Sep 17 00:00:00 2001 From: Rafael Barreto Date: Fri, 20 Aug 2010 19:12:37 +0000 Subject: [PATCH] fix wrong calculation git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5666 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/stream.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/source/src/stream.cpp b/source/src/stream.cpp index e3e32888..0dcac5da 100644 --- a/source/src/stream.cpp +++ b/source/src/stream.cpp @@ -381,7 +381,10 @@ struct filestream : stream if(file && strchr(mode,'w')) { int fail = fstatvfs(fileno(file), &buf); - if (fail || buf.f_frsize * (buf.f_bavail / 1000) < MINFSSIZE) +#ifndef STANDALONE +// if(!fail) conoutf("file test %lu %lu %lu",buf.f_frsize,buf.f_bsize, buf.f_bavail); +#endif + if (fail || buf.f_frsize * buf.f_bavail < MINFSSIZE) { close(); return false; @@ -711,7 +714,13 @@ stream *openrawfile(const char *filename, const char *mode) #endif if(!found) return NULL; filestream *file = new filestream; - if(!file->open(found, mode)) { delete file; return NULL; } + if(!file->open(found, mode)) + { +#ifndef STANDALONE +// conoutf("file failure! %s",filename); +#endif + delete file; return NULL; + } return file; }