diff options
Diffstat (limited to 'src/posix.c')
-rw-r--r-- | src/posix.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/posix.c b/src/posix.c index d2364d9b4..9d96d3013 100644 --- a/src/posix.c +++ b/src/posix.c @@ -31,10 +31,9 @@ int p_getcwd(char *buffer_out, size_t size) cwd_buffer = getcwd(buffer_out, size); if (cwd_buffer == NULL) - return git__throw(GIT_EOSERR, "Failed to retrieve current working directory"); + return -1; git_path_mkposix(buffer_out); - git_path_string_to_dir(buffer_out, size); //Ensure the path ends with a trailing slash return GIT_SUCCESS; @@ -44,14 +43,13 @@ int p_rename(const char *from, const char *to) { if (!link(from, to)) { p_unlink(from); - return GIT_SUCCESS; + return 0; } if (!rename(from, to)) - return GIT_SUCCESS; - - return GIT_ERROR; + return 0; + return -1; } #endif @@ -64,7 +62,7 @@ int p_read(git_file fd, void *buf, size_t cnt) if (r < 0) { if (errno == EINTR || errno == EAGAIN) continue; - return GIT_EOSERR; + return -1; } if (!r) break; @@ -82,14 +80,14 @@ int p_write(git_file fd, const void *buf, size_t cnt) if (r < 0) { if (errno == EINTR || errno == EAGAIN) continue; - return GIT_EOSERR; + return -1; } if (!r) { errno = EPIPE; - return GIT_EOSERR; + return -1; } cnt -= r; b += r; } - return GIT_SUCCESS; + return 0; } |