Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ad968be7
Commit
ad968be7
authored
Jun 18, 2014
by
Grazvydas Ignotas
Committed by
Alexandre Julliard
Jun 25, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Implement bufsiz block flushing behavior.
parent
c6a16069
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
file.c
dlls/msvcrt/file.c
+12
-0
file.c
dlls/msvcrt/tests/file.c
+1
-1
No files found.
dlls/msvcrt/file.c
View file @
ad968be7
...
...
@@ -3720,6 +3720,18 @@ MSVCRT_size_t CDECL MSVCRT_fwrite(const void *ptr, MSVCRT_size_t size, MSVCRT_si
}
written
+=
wrcnt
;
wrcnt
=
0
;
}
else
if
(
file
->
_bufsiz
&&
wrcnt
>=
file
->
_bufsiz
)
{
MSVCRT_size_t
pcnt
=
(
wrcnt
/
file
->
_bufsiz
)
*
file
->
_bufsiz
;
if
(
msvcrt_flush_buffer
(
file
)
==
MSVCRT_EOF
)
break
;
if
(
MSVCRT__write
(
file
->
_file
,
ptr
,
pcnt
)
<=
0
)
{
file
->
_flag
|=
MSVCRT__IOERR
;
break
;
}
written
+=
pcnt
;
wrcnt
-=
pcnt
;
ptr
=
(
const
char
*
)
ptr
+
pcnt
;
}
else
{
if
(
MSVCRT__flsbuf
(
*
(
const
char
*
)
ptr
,
file
)
==
MSVCRT_EOF
)
break
;
...
...
dlls/msvcrt/tests/file.c
View file @
ad968be7
...
...
@@ -2243,7 +2243,7 @@ static void test_write_flush_size(FILE *file, int bufsize)
fseek
(
file
,
0
,
SEEK_SET
);
ok
(
fread
(
inbuffer
,
1
,
bufsize
,
file
)
==
bufsize
,
"read failed
\n
"
);
if
(
size
==
bufsize
)
todo_wine
ok
(
memcmp
(
outbuffer
,
inbuffer
,
bufsize
)
==
0
,
"missing flush by %d byte write
\n
"
,
size
);
ok
(
memcmp
(
outbuffer
,
inbuffer
,
bufsize
)
==
0
,
"missing flush by %d byte write
\n
"
,
size
);
else
ok
(
memcmp
(
outbuffer
,
inbuffer
,
bufsize
)
!=
0
,
"unexpected flush by %d byte write
\n
"
,
size
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment