diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2014-05-14 19:12:48 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-05-17 01:39:43 +0200 |
commit | 0731a5b4db086eefac1a842e37526ef7bdbaa7de (patch) | |
tree | 8de449f06fae5e819e750ae7ae0f29cfe33574e6 /src/posix.h | |
parent | f7310540ae888454f9ab69200cfcd8df07faf957 (diff) | |
download | libgit2-0731a5b4db086eefac1a842e37526ef7bdbaa7de.tar.gz |
indexer: mmap fixes for Windowscmn/indexer-mmap
Windows has its own ftruncate() called _chsize_s().
p_mkstemp() is changed to use p_open() so we can make sure we open for
writing; the addition of exclusive create is a good thing to do
regardless, as we want a temporary path for ourselves.
Lastly, MSVC doesn't quite know how to add two numbers if one of them is a
void pointer, so let's alias it to unsigned char.C
Diffstat (limited to 'src/posix.h')
-rw-r--r-- | src/posix.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/posix.h b/src/posix.h index 745e4af75..965cd98d5 100644 --- a/src/posix.h +++ b/src/posix.h @@ -60,7 +60,6 @@ extern int p_write(git_file fd, const void *buf, size_t cnt); #define p_lseek(f,n,w) lseek(f, n, w) #define p_close(fd) close(fd) #define p_umask(m) umask(m) -#define p_ftruncate(fd, sz) ftruncate(fd, sz) extern int p_open(const char *path, int flags, ...); extern int p_creat(const char *path, mode_t mode); @@ -74,6 +73,7 @@ extern int p_rename(const char *from, const char *to); #define p_rmdir(p) rmdir(p) #define p_chmod(p,m) chmod(p, m) #define p_access(p,m) access(p,m) +#define p_ftruncate(fd, sz) ftruncate(fd, sz) #define p_recv(s,b,l,f) recv(s,b,l,f) #define p_send(s,b,l,f) send(s,b,l,f) typedef int GIT_SOCKET; |