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
d0e4a765
Commit
d0e4a765
authored
Feb 17, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure get_file_size uses a valid fd (spotted by Uwe Bonnes).
parent
851d25d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
mapping.c
server/mapping.c
+3
-3
No files found.
server/mapping.c
View file @
d0e4a765
...
@@ -241,10 +241,10 @@ static int get_image_params( struct mapping *mapping )
...
@@ -241,10 +241,10 @@ static int get_image_params( struct mapping *mapping )
}
}
/* get the size of the unix file associated with the mapping */
/* get the size of the unix file associated with the mapping */
inline
static
int
get_file_size
(
struct
mapping
*
mapping
,
int
*
size_high
,
int
*
size_low
)
inline
static
int
get_file_size
(
struct
file
*
file
,
int
*
size_high
,
int
*
size_low
)
{
{
struct
stat
st
;
struct
stat
st
;
int
unix_fd
=
get_
unix_fd
(
mapping
->
obj
.
fd_obj
);
int
unix_fd
=
get_
file_unix_fd
(
file
);
if
(
fstat
(
unix_fd
,
&
st
)
==
-
1
)
return
0
;
if
(
fstat
(
unix_fd
,
&
st
)
==
-
1
)
return
0
;
*
size_high
=
st
.
st_size
>>
32
;
*
size_high
=
st
.
st_size
>>
32
;
...
@@ -283,7 +283,7 @@ static struct object *create_mapping( int size_high, int size_low, int protect,
...
@@ -283,7 +283,7 @@ static struct object *create_mapping( int size_high, int size_low, int protect,
}
}
if
(
!
size_high
&&
!
size_low
)
if
(
!
size_high
&&
!
size_low
)
{
{
if
(
!
get_file_size
(
mapping
,
&
size_high
,
&
size_low
))
goto
error
;
if
(
!
get_file_size
(
mapping
->
file
,
&
size_high
,
&
size_low
))
goto
error
;
}
}
else
else
{
{
...
...
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