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
ffb4956f
Commit
ffb4956f
authored
Jun 01, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added fallback read() for missing/failing mmap().
parent
9a624916
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
pe.c
tools/winedump/pe.c
+13
-3
No files found.
tools/winedump/pe.c
View file @
ffb4956f
...
...
@@ -822,8 +822,13 @@ int pe_analysis(const char* name, void (*fn)(void), enum FileSig wanted_sig)
if
(
fstat
(
fd
,
&
s
)
<
0
)
fatal
(
"Can't get size"
);
total_len
=
s
.
st_size
;
base
=
mmap
(
NULL
,
total_len
,
PROT_READ
,
MAP_PRIVATE
,
fd
,
0
);
if
(
base
==
(
void
*
)
-
1
)
fatal
(
"Can't map file"
);
#ifdef HAVE_MMAP
if
((
base
=
mmap
(
NULL
,
total_len
,
PROT_READ
,
MAP_PRIVATE
,
fd
,
0
))
==
(
void
*
)
-
1
)
#endif
{
if
(
!
(
base
=
malloc
(
total_len
)))
fatal
(
"Out of memory"
);
if
(
read
(
fd
,
base
,
total_len
)
!=
total_len
)
fatal
(
"Cannot read file"
);
}
effective_sig
=
check_headers
();
...
...
@@ -856,7 +861,12 @@ int pe_analysis(const char* name, void (*fn)(void), enum FileSig wanted_sig)
}
if
(
ret
)
printf
(
"Done dumping %s
\n
"
,
name
);
munmap
(
base
,
total_len
);
#ifdef HAVE_MMAP
if
(
munmap
(
base
,
total_len
)
==
-
1
)
#endif
{
free
(
base
);
}
close
(
fd
);
return
ret
;
...
...
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