summaryrefslogtreecommitdiff
path: root/src/fileops.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2010-12-23 00:15:09 +0200
committerVicent Marti <tanoku@gmail.com>2010-12-23 00:15:09 +0200
commit9f54fe482dd369ebbae67b0b33f7efde206ba249 (patch)
tree5b239e63f5040ebece759c5143ea44916d17bb63 /src/fileops.c
parent11f6646f032c669170453e8e359ac337fa9abbb7 (diff)
downloadlibgit2-9f54fe482dd369ebbae67b0b33f7efde206ba249.tar.gz
Remove git_errno
It was not being used by any methods (only by malloc and calloc), and since it needs to be TLS, it cannot be exported on DLLs on Windows. Burn it with fire. The API always returns error codes! Signed-off-by: Vicent Marti <tanoku@gmail.com>
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 a25796a7b..5d7e92978 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -4,13 +4,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)
@@ -21,11 +21,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;
@@ -41,11 +41,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;
@@ -92,7 +92,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;
}
@@ -151,13 +151,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;
}
@@ -275,7 +275,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;