Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
450ac186
Commit
450ac186
authored
May 19, 2011
by
Jakob Pfender
Committed by
Vicent Marti
May 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unix/map.c: Move to new error handling mechanism
parent
57435a6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
src/unix/map.c
+5
-5
No files found.
src/unix/map.c
View file @
450ac186
...
...
@@ -13,7 +13,7 @@ int git__mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t o
if
((
out
==
NULL
)
||
(
len
==
0
))
{
errno
=
EINVAL
;
return
GIT_ERROR
;
return
git__throw
(
GIT_ERROR
,
"Failed to mmap. No map or zero length"
)
;
}
out
->
data
=
NULL
;
...
...
@@ -25,7 +25,7 @@ int git__mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t o
mprot
=
PROT_READ
;
else
{
errno
=
EINVAL
;
return
GIT_ERROR
;
return
git__throw
(
GIT_ERROR
,
"Failed to mmap. Invalid protection parameters"
)
;
}
if
((
flags
&
GIT_MAP_TYPE
)
==
GIT_MAP_SHARED
)
...
...
@@ -35,12 +35,12 @@ int git__mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t o
if
(
flags
&
GIT_MAP_FIXED
)
{
errno
=
EINVAL
;
return
GIT_ERROR
;
return
git__throw
(
GIT_ERROR
,
"Failed to mmap. FIXED not set"
)
;
}
out
->
data
=
mmap
(
NULL
,
len
,
mprot
,
mflag
,
fd
,
offset
);
if
(
!
out
->
data
||
out
->
data
==
MAP_FAILED
)
return
GIT_EOSERR
;
return
git__throw
(
GIT_EOSERR
,
"Failed to mmap. Could not write data"
)
;
out
->
len
=
len
;
return
GIT_SUCCESS
;
...
...
@@ -51,7 +51,7 @@ int git__munmap(git_map *map)
assert
(
map
!=
NULL
);
if
(
!
map
)
return
GIT_ERROR
;
return
git__throw
(
GIT_ERROR
,
"Failed to munmap. Map does not exist"
)
;
munmap
(
map
->
data
,
map
->
len
);
...
...
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