[3/5] msvcrt: change internal buffer size to 4k. (try 3)

Grazvydas Ignotas notasas at gmail.com
Fri Jun 13 18:23:56 CDT 2014


---
 dlls/msvcrt/file.c       |    6 ++++--
 dlls/msvcrt/tests/file.c |    2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c
index 7590510..7523bbb 100644
--- a/dlls/msvcrt/file.c
+++ b/dlls/msvcrt/file.c
@@ -81,6 +81,8 @@ static char utf16_bom[2] = { 0xff, 0xfe };
 #define MSVCRT_MAX_FILES 2048
 #define MSVCRT_FD_BLOCK_SIZE 32
 
+#define MSVCRT_INTERNAL_BUFSIZ 4096
+
 /* ioinfo structure size is different in msvcrXX.dll's */
 typedef struct {
     HANDLE              handle;
@@ -619,9 +621,9 @@ static BOOL msvcrt_alloc_buffer(MSVCRT_FILE* file)
             && MSVCRT__isatty(file->_file))
         return FALSE;
 
-    file->_base = MSVCRT_calloc(MSVCRT_BUFSIZ,1);
+    file->_base = MSVCRT_calloc(MSVCRT_INTERNAL_BUFSIZ,1);
     if(file->_base) {
-        file->_bufsiz = MSVCRT_BUFSIZ;
+        file->_bufsiz = MSVCRT_INTERNAL_BUFSIZ;
         file->_flag |= MSVCRT__IOMYBUF;
     } else {
         file->_base = (char*)(&file->_charbuf);
diff --git a/dlls/msvcrt/tests/file.c b/dlls/msvcrt/tests/file.c
index 00e1f90..c98adf4 100644
--- a/dlls/msvcrt/tests/file.c
+++ b/dlls/msvcrt/tests/file.c
@@ -2269,7 +2269,7 @@ static void test_write_flush(void)
     ok(file != NULL, "unable to create test file\n");
     iobuf[0] = 0;
     fwrite(iobuf, 1, 1, file); /* needed for wine to init _bufsiz */
-    todo_wine ok(file->_bufsiz == 4096, "incorrect default buffer size: %d", file->_bufsiz);
+    ok(file->_bufsiz == 4096, "incorrect default buffer size: %d", file->_bufsiz);
     test_write_flush_size(file, file->_bufsiz);
     setvbuf(file, iobuf, _IOFBF, sizeof(iobuf));
     test_write_flush_size(file, sizeof(iobuf));
-- 
1.7.9.5




More information about the wine-patches mailing list