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
b4c69e0f
Commit
b4c69e0f
authored
Sep 08, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a file descriptor leak when opening the first file on a removable
device.
parent
b3b5ab89
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
server.c
dlls/ntdll/server.c
+10
-11
No files found.
dlls/ntdll/server.c
View file @
b4c69e0f
...
...
@@ -487,7 +487,11 @@ int wine_server_handle_to_fd( obj_handle_t handle, unsigned int access, int *uni
SERVER_END_REQ
;
if
(
ret
)
return
ret
;
if
(
fd
!=
-
1
)
break
;
if
(
fd
!=
-
1
)
{
if
((
fd
=
dup
(
fd
))
==
-
1
)
return
FILE_GetNtStatus
();
break
;
}
/* it wasn't in the cache, get it from the server */
fd
=
receive_fd
(
&
fd_handle
);
...
...
@@ -500,11 +504,7 @@ int wine_server_handle_to_fd( obj_handle_t handle, unsigned int access, int *uni
if
(
FILE_GetDeviceInfo
(
fd
,
&
info
)
==
STATUS_SUCCESS
)
removable
=
(
info
.
Characteristics
&
FILE_REMOVABLE_MEDIA
)
!=
0
;
}
else
if
(
removable
)
/* don't cache it */
{
*
unix_fd
=
fd
;
return
STATUS_SUCCESS
;
}
else
if
(
removable
)
break
;
/* don't cache it */
/* and store it back into the cache */
SERVER_START_REQ
(
set_handle_fd
)
...
...
@@ -514,11 +514,10 @@ int wine_server_handle_to_fd( obj_handle_t handle, unsigned int access, int *uni
req
->
removable
=
removable
;
if
(
!
(
ret
=
wine_server_call
(
req
)))
{
if
(
reply
->
cur_fd
!=
fd
&&
reply
->
cur_fd
!=
-
1
)
if
(
reply
->
cur_fd
!=
-
1
)
/* it has been cached */
{
/* someone was here before us */
close
(
fd
);
fd
=
reply
->
cur_fd
;
if
(
reply
->
cur_fd
!=
fd
)
close
(
fd
);
/* someone was here before us */
if
((
fd
=
dup
(
reply
->
cur_fd
))
==
-
1
)
ret
=
FILE_GetNtStatus
();
}
}
else
...
...
@@ -535,9 +534,9 @@ int wine_server_handle_to_fd( obj_handle_t handle, unsigned int access, int *uni
* a race with another thread; we restart everything from
* scratch in this case.
*/
close
(
fd
);
}
if
((
fd
!=
-
1
)
&&
((
fd
=
dup
(
fd
))
==
-
1
))
return
STATUS_TOO_MANY_OPENED_FILES
;
*
unix_fd
=
fd
;
return
STATUS_SUCCESS
;
}
...
...
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