]> git.proxmox.com Git - libgit2.git/commitdiff
Merge remote-tracking branch 'source/development' into update-test
authorChris Young <chris@unsatisfactorysoftware.co.uk>
Thu, 7 Jun 2012 19:29:22 +0000 (20:29 +0100)
committerChris Young <chris@unsatisfactorysoftware.co.uk>
Thu, 7 Jun 2012 19:29:22 +0000 (20:29 +0100)
Merging main libgit2!
Conflicts:
CMakeLists.txt
src/unix/map.c

1  2 
CMakeLists.txt
include/git2/types.h
src/unix/map.c

diff --cc CMakeLists.txt
Simple merge
Simple merge
diff --cc src/unix/map.c
index 1613152a05bb1bb27f24a182cfc21d591f4158b7,772f4e2473ea98cedbbf8c2af021547bc7d3e1c0..65f4ac91c5af5a4347ef3768c363159d108f7fa4
@@@ -1,14 -1,19 +1,22 @@@
+ /*
+  * Copyright (C) 2009-2012 the libgit2 contributors
+  *
+  * This file is part of libgit2, distributed under the GNU GPL v2 with
+  * a Linking Exception. For full terms see the included COPYING file.
+  */
+ #include <git2/common.h>
+ #ifndef GIT_WIN32
  
  #include "map.h"
 +#ifndef __amigaos4__
  #include <sys/mman.h>
 +#endif
  #include <errno.h>
  
- int git__mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offset)
+ int p_mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offset)
  {
 +#ifndef __amigaos4__
        int mprot = 0;
        int mflag = 0;
  
        else if ((flags & GIT_MAP_TYPE) == GIT_MAP_PRIVATE)
                mflag = MAP_PRIVATE;
  
-       if (flags & GIT_MAP_FIXED) {
-               errno = EINVAL;
-               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) {
+               giterr_set(GITERR_OS, "Failed to mmap. Could not write data");
+               return -1;
        }
  
-       out->data = mmap(NULL, len, mprot, mflag, fd, offset);
-       if (!out->data || out->data == MAP_FAILED)
-               return git__throw(GIT_EOSERR, "Failed to mmap. Could not write data");
        out->len = len;
 -
 +#endif
-       return GIT_SUCCESS;
+       return 0;
  }
  
- int git__munmap(git_map *map)
+ int p_munmap(git_map *map)
  {
 +#ifndef __amigaos4__
        assert(map != NULL);
-       if (!map)
-               return git__throw(GIT_ERROR, "Failed to munmap. Map does not exist");
        munmap(map->data, map->len);
-       return GIT_SUCCESS;
 +#endif
+       return 0;
  }
  
+ #endif