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
db92137f
Commit
db92137f
authored
Mar 01, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 04, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Reuse standard file descriptors after closing them.
parent
f565e4a3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
file.c
dlls/msvcrt/file.c
+6
-9
No files found.
dlls/msvcrt/file.c
View file @
db92137f
...
...
@@ -251,40 +251,37 @@ static HANDLE msvcrt_fdtoh(int fd)
/* INTERNAL: free a file entry fd */
static
void
msvcrt_free_fd
(
int
fd
)
{
HANDLE
old_handle
;
ioinfo
*
fdinfo
;
LOCK_FILES
();
fdinfo
=
msvcrt_get_ioinfo
(
fd
);
old_handle
=
fdinfo
->
handle
;
if
(
fdinfo
!=
&
MSVCRT___badioinfo
)
{
fdinfo
->
handle
=
INVALID_HANDLE_VALUE
;
fdinfo
->
wxflag
=
0
;
}
TRACE
(
":fd (%d) freed
\n
"
,
fd
);
if
(
fd
<
3
)
/* don't use 0,1,2 for user files */
if
(
fd
<
3
)
{
switch
(
fd
)
{
case
0
:
if
(
GetStdHandle
(
STD_INPUT_HANDLE
)
==
old_handle
)
SetStdHandle
(
STD_INPUT_HANDLE
,
0
);
SetStdHandle
(
STD_INPUT_HANDLE
,
0
);
break
;
case
1
:
if
(
GetStdHandle
(
STD_OUTPUT_HANDLE
)
==
old_handle
)
SetStdHandle
(
STD_OUTPUT_HANDLE
,
0
);
SetStdHandle
(
STD_OUTPUT_HANDLE
,
0
);
break
;
case
2
:
if
(
GetStdHandle
(
STD_ERROR_HANDLE
)
==
old_handle
)
SetStdHandle
(
STD_ERROR_HANDLE
,
0
);
SetStdHandle
(
STD_ERROR_HANDLE
,
0
);
break
;
}
}
else
{
if
(
fd
==
MSVCRT_fdend
-
1
)
MSVCRT_fdend
--
;
if
(
fd
<
MSVCRT_fdstart
)
MSVCRT_fdstart
=
fd
;
}
UNLOCK_FILES
();
}
...
...
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