summaryrefslogtreecommitdiff
path: root/src/posix.c
diff options
context:
space:
mode:
authorAlbert Meltzer <kitbellew@users.noreply.github.com>2014-05-18 07:54:41 -0700
committerAlbert Meltzer <kitbellew@users.noreply.github.com>2014-05-19 17:37:29 -0700
commit62e562f92b45b6a9b124452f7de6b9e86a179224 (patch)
tree96562679577257795f9ab425faae8b953bf0c051 /src/posix.c
parent588a43af543f9a00345a6e464a61c51aebad88da (diff)
downloadlibgit2-62e562f92b45b6a9b124452f7de6b9e86a179224.tar.gz
Fix compiler warning (git_off_t cast to size_t).
Use size_t for page size, instead of long. Check result of sysconf. Use size_t for page offset so no cast to size_t (second arg to p_mmap). Use mod instead div/mult pair, so no cast to size_t is necessary.
Diffstat (limited to 'src/posix.c')
-rw-r--r--src/posix.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/posix.c b/src/posix.c
index 7aeb0e6c1..7db633628 100644
--- a/src/posix.c
+++ b/src/posix.c
@@ -207,10 +207,11 @@ int p_write(git_file fd, const void *buf, size_t cnt)
#include "map.h"
-long git__page_size(void)
+int git__page_size(size_t *page_size)
{
/* dummy; here we don't need any alignment anyway */
- return 4096;
+ *page_size = 4096;
+ return 0;
}