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
f896cd3d
Commit
f896cd3d
authored
Oct 28, 2014
by
Iván Matellanes
Committed by
Alexandre Julliard
Oct 31, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: _filbuf should not lock any file.
parent
2c5f05b8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
11 deletions
+9
-11
msvcr90.c
dlls/msvcr90/tests/msvcr90.c
+7
-0
file.c
dlls/msvcrt/file.c
+2
-11
No files found.
dlls/msvcr90/tests/msvcr90.c
View file @
f896cd3d
...
...
@@ -118,6 +118,7 @@ static int (__cdecl *p_fileno)(FILE*);
static
int
(
__cdecl
*
p_feof
)(
FILE
*
);
static
int
(
__cdecl
*
p_ferror
)(
FILE
*
);
static
int
(
__cdecl
*
p_flsbuf
)(
int
,
FILE
*
);
static
int
(
__cdecl
*
p_filbuf
)(
FILE
*
);
static
unsigned
long
(
__cdecl
*
p_byteswap_ulong
)(
unsigned
long
);
static
void
**
(
__cdecl
*
p__pxcptinfoptrs
)(
void
);
static
void
*
(
__cdecl
*
p__AdjustPointer
)(
void
*
,
const
void
*
);
...
...
@@ -377,6 +378,7 @@ static BOOL init(void)
SET
(
p_feof
,
"feof"
);
SET
(
p_ferror
,
"ferror"
);
SET
(
p_flsbuf
,
"_flsbuf"
);
SET
(
p_filbuf
,
"_filbuf"
);
SET
(
p_byteswap_ulong
,
"_byteswap_ulong"
);
SET
(
p__pxcptinfoptrs
,
"__pxcptinfoptrs"
);
SET
(
p__AdjustPointer
,
"__AdjustPointer"
);
...
...
@@ -1285,6 +1287,11 @@ static void test_nonblocking_file_access(void)
ret
=
p_flsbuf
(
'a'
,
filew
);
ok
(
ret
==
'a'
,
"_flsbuf(filew) returned %d
\n
"
,
ret
);
ret
=
p_filbuf
(
filer
);
ok
(
ret
==-
1
,
"_filbuf(filer) returned %d
\n
"
,
ret
);
ret
=
p_filbuf
(
filew
);
ok
(
ret
==-
1
,
"_filbuf(filew) returned %d
\n
"
,
ret
);
ret
=
p_fflush_nolock
(
filer
);
ok
(
ret
==
0
,
"_fflush_nolock(filer) returned %d
\n
"
,
ret
);
ret
=
p_fflush_nolock
(
filew
);
...
...
dlls/msvcrt/file.c
View file @
f896cd3d
...
...
@@ -3460,12 +3460,9 @@ int CDECL MSVCRT_ferror(MSVCRT_FILE* file)
int
CDECL
MSVCRT__filbuf
(
MSVCRT_FILE
*
file
)
{
unsigned
char
c
;
MSVCRT__lock_file
(
file
);
if
(
file
->
_flag
&
MSVCRT__IOSTRG
)
{
MSVCRT__unlock_file
(
file
);
if
(
file
->
_flag
&
MSVCRT__IOSTRG
)
return
MSVCRT_EOF
;
}
/* Allocate buffer if needed */
if
(
!
(
file
->
_flag
&
(
MSVCRT__IONBF
|
MSVCRT__IOMYBUF
|
MSVCRT__USERBUF
)))
...
...
@@ -3474,35 +3471,29 @@ int CDECL MSVCRT__filbuf(MSVCRT_FILE* file)
if
(
!
(
file
->
_flag
&
MSVCRT__IOREAD
))
{
if
(
file
->
_flag
&
MSVCRT__IORW
)
file
->
_flag
|=
MSVCRT__IOREAD
;
else
{
MSVCRT__unlock_file
(
file
);
else
return
MSVCRT_EOF
;
}
}
if
(
!
(
file
->
_flag
&
(
MSVCRT__IOMYBUF
|
MSVCRT__USERBUF
)))
{
int
r
;
if
((
r
=
read_i
(
file
->
_file
,
&
c
,
1
))
!=
1
)
{
file
->
_flag
|=
(
r
==
0
)
?
MSVCRT__IOEOF
:
MSVCRT__IOERR
;
MSVCRT__unlock_file
(
file
);
return
MSVCRT_EOF
;
}
MSVCRT__unlock_file
(
file
);
return
c
;
}
else
{
file
->
_cnt
=
read_i
(
file
->
_file
,
file
->
_base
,
file
->
_bufsiz
);
if
(
file
->
_cnt
<=
0
)
{
file
->
_flag
|=
(
file
->
_cnt
==
0
)
?
MSVCRT__IOEOF
:
MSVCRT__IOERR
;
file
->
_cnt
=
0
;
MSVCRT__unlock_file
(
file
);
return
MSVCRT_EOF
;
}
file
->
_cnt
--
;
file
->
_ptr
=
file
->
_base
+
1
;
c
=
*
(
unsigned
char
*
)
file
->
_base
;
MSVCRT__unlock_file
(
file
);
return
c
;
}
}
...
...
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