Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
d8ddd2a2
Commit
d8ddd2a2
authored
12 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Fix errors in Win32 implementation of xpmap().
parent
5fc7b2d0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/xpdev/xpmap.c
+3
-7
3 additions, 7 deletions
src/xpdev/xpmap.c
with
3 additions
and
7 deletions
src/xpdev/xpmap.c
+
3
−
7
View file @
d8ddd2a2
...
...
@@ -36,10 +36,10 @@
****************************************************************************/
#include
"xpmap.h"
#include
<stdlib.h>
// malloc()
#if defined(__unix__)
#include
<stdlib.h>
// malloc()
#include
<unistd.h>
// close()
#include
<fcntl.h>
#include
<sys/mman.h>
...
...
@@ -98,15 +98,14 @@ void xpunmap(struct xpmapping *map)
free
(
map
);
}
#elif defined(_WIN32)
#elif defined(_WIN32)
struct
xpmapping
*
xpmap
(
const
char
*
filename
,
enum
xpmap_type
type
)
{
H
AND
LE
fd
;
H
FI
LE
fd
;
HANDLE
md
;
OFSTRUCT
of
;
UINT
oflags
;
DWORD
mattrs
;
DWORD
mprot
;
DWORD
maccess
;
DWORD
size
;
...
...
@@ -117,19 +116,16 @@ struct xpmapping *xpmap(const char *filename, enum xpmap_type type)
case
XPMAP_READ
:
oflags
=
OF_READ
|
OF_SHARE_DENY_NONE
;
mprot
=
PAGE_READONLY
;
mattrs
=
0
;
maccess
=
FILE_MAP_READ
;
break
;
case
XPMAP_WRITE
:
oflags
=
OF_READWRITE
|
OF_SHARE_DENY_NONE
;
mprot
=
PAGE_READWRITE
;
mflags
=
0
;
maccess
=
FILE_MAP_WRITE
;
break
;
case
XPMAP_COPY
:
oflags
=
OF_READ
|
OF_SHARE_DENY_NONE
;
mprot
=
PAGE_WRITECOPY
;
mflags
=
0
;
maccess
=
FILE_MAP_COPY
;
break
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment