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
015f31fd
Commit
015f31fd
authored
Apr 03, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Avoid using mmap().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
44dc9d73
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
11 deletions
+3
-11
utils.c
tools/winebuild/utils.c
+3
-11
No files found.
tools/winebuild/utils.c
View file @
015f31fd
...
...
@@ -33,9 +33,6 @@
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#include "build.h"
...
...
@@ -540,18 +537,13 @@ void init_input_buffer( const char *file )
{
int
fd
;
struct
stat
st
;
unsigned
char
*
buffer
;
if
((
fd
=
open
(
file
,
O_RDONLY
|
O_BINARY
))
==
-
1
)
fatal_perror
(
"Cannot open %s"
,
file
);
if
((
fstat
(
fd
,
&
st
)
==
-
1
))
fatal_perror
(
"Cannot stat %s"
,
file
);
if
(
!
st
.
st_size
)
fatal_error
(
"%s is an empty file
\n
"
,
file
);
#ifdef HAVE_MMAP
if
((
input_buffer
=
mmap
(
NULL
,
st
.
st_size
,
PROT_READ
,
MAP_PRIVATE
,
fd
,
0
))
==
(
void
*
)
-
1
)
#endif
{
unsigned
char
*
buffer
=
xmalloc
(
st
.
st_size
);
if
(
read
(
fd
,
buffer
,
st
.
st_size
)
!=
st
.
st_size
)
fatal_error
(
"Cannot read %s
\n
"
,
file
);
input_buffer
=
buffer
;
}
input_buffer
=
buffer
=
xmalloc
(
st
.
st_size
);
if
(
read
(
fd
,
buffer
,
st
.
st_size
)
!=
st
.
st_size
)
fatal_error
(
"Cannot read %s
\n
"
,
file
);
close
(
fd
);
input_buffer_filename
=
xstrdup
(
file
);
input_buffer_size
=
st
.
st_size
;
...
...
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