Commit d043013f by Chris Young

More changes resulting from pull request

parent a8df98c6
Nasty build hack:
When setting SHA1 to ppc in CMakeLists.txt, after running initial CMake,
copy src/ppc/sha1ppc.S.obj to build/CMakeFiles/git2.dir/src/ppc/
Add CMakeFiles/git2.dir/src/ppc/sha1ppc.S.obj to the list in build/CMakeFiles/git2.dir/link.txt
...@@ -14,9 +14,6 @@ ...@@ -14,9 +14,6 @@
int p_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)
{ {
int mprot = 0;
int mflag = 0;
GIT_MMAP_VALIDATE(out, len, prot, flags); GIT_MMAP_VALIDATE(out, len, prot, flags);
out->data = NULL; out->data = NULL;
...@@ -27,12 +24,12 @@ int p_mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offs ...@@ -27,12 +24,12 @@ int p_mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offs
return -1; return -1;
} }
if(out->data = malloc(len)) { if((out->data = malloc(len))) {
p_lseek(fd, offset, SEEK_SET); p_lseek(fd, offset, SEEK_SET);
p_read(fd, out->data, len); p_read(fd, out->data, len);
} }
if (!out->data || out->data == MAP_FAILED) { if (!out->data || (out->data == MAP_FAILED)) {
giterr_set(GITERR_OS, "Failed to mmap. Could not write data"); giterr_set(GITERR_OS, "Failed to mmap. Could not write data");
return -1; return -1;
} }
......
...@@ -430,7 +430,7 @@ int gitno_connect(git_transport *t, const char *host, const char *port) ...@@ -430,7 +430,7 @@ int gitno_connect(git_transport *t, const char *host, const char *port)
#else #else
memcpy(&hints.ai_addr.sin_addr, hints.ai_hostent->h_addr_list[p], hints.ai_hostent->h_length); memcpy(&hints.ai_addr.sin_addr, hints.ai_hostent->h_addr_list[p], hints.ai_hostent->h_length);
hints.ai_addr.sin_family = hints.ai_hostent->h_addrtype; hints.ai_addr.sin_family = hints.ai_hostent->h_addrtype;
hints.ai_addr.sin_port = honts.ai_port; hints.ai_addr.sin_port = hints.ai_port;
if (connect(s, (struct sockaddr *)&hints.ai_addr, sizeof(struct sockaddr_in)) == 0) if (connect(s, (struct sockaddr *)&hints.ai_addr, sizeof(struct sockaddr_in)) == 0)
#endif #endif
break; break;
......
...@@ -516,7 +516,7 @@ int git_path_direach( ...@@ -516,7 +516,7 @@ int git_path_direach(
de_buf = git__malloc(sizeof(struct dirent)); de_buf = git__malloc(sizeof(struct dirent));
#endif #endif
while (p_readdir_r(dir, de_buf, de) == 0 && de != NULL) { while (p_readdir_r(dir, de_buf, &de) == 0 && de != NULL) {
int result; int result;
if (is_dot_or_dotdot(de->d_name)) if (is_dot_or_dotdot(de->d_name))
...@@ -574,7 +574,7 @@ int git_path_dirload( ...@@ -574,7 +574,7 @@ int git_path_dirload(
path_len -= prefix_len; path_len -= prefix_len;
need_slash = (path_len > 0 && path[path_len-1] != '/') ? 1 : 0; need_slash = (path_len > 0 && path[path_len-1] != '/') ? 1 : 0;
while ((error = p_readdir_r(dir, de_buf, de)) == 0 && de != NULL) { while ((error = p_readdir_r(dir, de_buf, &de)) == 0 && de != NULL) {
char *entry_path; char *entry_path;
size_t entry_len; size_t entry_len;
......
...@@ -84,9 +84,10 @@ extern int p_gettimeofday(struct timeval *tv, struct timezone *tz); ...@@ -84,9 +84,10 @@ extern int p_gettimeofday(struct timeval *tv, struct timezone *tz);
#endif #endif
#ifndef NO_READDIR_R #ifndef NO_READDIR_R
#define p_readdir_r(d,e,r) readdir_r(d,e,&r) #define p_readdir_r(d,e,r) readdir_r(d,e,r)
#else #else
GIT_INLINE(int) p_readdir_r(DIR *dirp, struct dirent *entry, struct direct **result) #include <dirent.h>
GIT_INLINE(int) p_readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result)
{ {
GIT_UNUSED(entry); GIT_UNUSED(entry);
*result = readdir(dirp); *result = readdir(dirp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment