Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/unix
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2012-06-14 02:16:14 +0400
committerChris Young <chris@unsatisfactorysoftware.co.uk>2012-06-14 02:16:14 +0400
commit96ef3d84629ef72fb662d95abbab3de634921678 (patch)
tree1859c8ce4b577acce3c5561d7f749f5a23574d58 /src/unix
parent2aeadb9c78df4b463ffb3293e242e19a7e0d17a9 (diff)
Make this more generic and mergeable.
Needs AmigaOS.cmake now from CMake package at OS4Depot, or contents below: --8<-- SET(AMIGA 1) SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") --8<--
Diffstat (limited to 'src/unix')
-rw-r--r--src/unix/map.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/unix/map.c b/src/unix/map.c
index b04e95a76..9dcae5845 100644
--- a/src/unix/map.c
+++ b/src/unix/map.c
@@ -9,9 +9,7 @@
#ifndef GIT_WIN32
#include "map.h"
-#ifndef __amigaos4__
#include <sys/mman.h>
-#endif
#include <errno.h>
int p_mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offset)
@@ -24,7 +22,6 @@ int p_mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offs
out->data = NULL;
out->len = 0;
-#ifndef __amigaos4__
if (prot & GIT_PROT_WRITE)
mprot = PROT_WRITE;
else if (prot & GIT_PROT_READ)
@@ -36,16 +33,6 @@ int p_mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offs
mflag = MAP_PRIVATE;
out->data = mmap(NULL, len, mprot, mflag, fd, offset);
-#else
- if ((prot & GIT_PROT_WRITE) && ((flags & GIT_MAP_TYPE) == GIT_MAP_SHARED)) {
- printf("Trying to map shared-writeable file!!!\n");
- }
-
- if(out->data = malloc(len)) {
- lseek(fd, offset, SEEK_SET);
- p_read(fd, out->data, len);
- }
-#endif
if (!out->data || out->data == MAP_FAILED) {
giterr_set(GITERR_OS, "Failed to mmap. Could not write data");
@@ -60,11 +47,8 @@ int p_mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offs
int p_munmap(git_map *map)
{
assert(map != NULL);
-#ifndef __amigaos4__
munmap(map->data, map->len);
-#else
- free(map->data);
-#endif
+
return 0;
}