summaryrefslogtreecommitdiff
path: root/src/fileops.c
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2010-12-23 09:22:15 +0100
committernulltoken <emeric.fermas@gmail.com>2010-12-23 09:22:15 +0100
commit98e3b298955557ae10d6682ea33eb8ba8a5447a5 (patch)
tree930944b565777406a48c9243e544b2110fcc3c80 /src/fileops.c
parent2c08c3f0742d812bd3790c2541af87634fbb3ab4 (diff)
parent51035184ddcc7f5a4437f57e04474b4bb98d8a49 (diff)
downloadlibgit2-98e3b298955557ae10d6682ea33eb8ba8a5447a5.tar.gz
Merge branch 'master' into repo-init
Diffstat (limited to 'src/fileops.c')
-rw-r--r--src/fileops.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/fileops.c b/src/fileops.c
index 5f5944c62..7b11c9c3a 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -5,13 +5,13 @@
int gitfo_open(const char *path, int flags)
{
int fd = open(path, flags | O_BINARY);
- return fd >= 0 ? fd : git_os_error();
+ return fd >= 0 ? fd : GIT_EOSERR;
}
int gitfo_creat(const char *path, int mode)
{
int fd = open(path, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, mode);
- return fd >= 0 ? fd : git_os_error();
+ return fd >= 0 ? fd : GIT_EOSERR;
}
int gitfo_read(git_file fd, void *buf, size_t cnt)
@@ -22,11 +22,11 @@ int gitfo_read(git_file fd, void *buf, size_t cnt)
if (r < 0) {
if (errno == EINTR || errno == EAGAIN)
continue;
- return git_os_error();
+ return GIT_EOSERR;
}
if (!r) {
errno = EPIPE;
- return git_os_error();
+ return GIT_EOSERR;
}
cnt -= r;
b += r;
@@ -42,11 +42,11 @@ int gitfo_write(git_file fd, void *buf, size_t cnt)
if (r < 0) {
if (errno == EINTR || errno == EAGAIN)
continue;
- return git_os_error();
+ return GIT_EOSERR;
}
if (!r) {
errno = EPIPE;
- return git_os_error();
+ return GIT_EOSERR;
}
cnt -= r;
b += r;
@@ -93,7 +93,7 @@ off_t gitfo_size(git_file fd)
{
struct stat sb;
if (gitfo_fstat(fd, &sb))
- return git_os_error();
+ return GIT_EOSERR;
return sb.st_size;
}
@@ -152,13 +152,13 @@ int gitfo_move_file(char *from, char *to)
if (!rename(from, to))
return GIT_SUCCESS;
- return git_os_error();
+ return GIT_EOSERR;
}
int gitfo_map_ro(git_map *out, git_file fd, off_t begin, size_t len)
{
if (git__mmap(out, len, GIT_PROT_READ, GIT_MAP_SHARED, fd, begin) < GIT_SUCCESS)
- return git_os_error();
+ return GIT_EOSERR;
return GIT_SUCCESS;
}
@@ -276,7 +276,7 @@ int gitfo_dirent(
dir = opendir(path);
if (!dir)
- return git_os_error();
+ return GIT_EOSERR;
while ((de = readdir(dir)) != NULL) {
size_t de_len;