Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-07-04 13:43:34 +0400
committerVicent Marti <tanoku@gmail.com>2011-07-05 04:04:03 +0400
commitf79026b4912bcd2336667f4c1663c06e233f0b32 (patch)
tree645b776032e924b587fad986aa3f3dc08c98d4c5 /src/blob.c
parent678e9e045becdc5d75f2ce2259ed01c3531ee181 (diff)
fileops: Cleanup
Cleaned up the structure of the whole OS-abstraction layer. fileops.c now contains a set of utility methods for file management used by the library. These are abstractions on top of the original POSIX calls. There's a new file called `posix.c` that contains emulations/reimplementations of all the POSIX calls the library uses. These are prefixed with `p_`. There's a specific posix file for each platform (win32 and unix). All the path-related methods have been moved from `utils.c` to `path.c` and have their own prefix.
Diffstat (limited to 'src/blob.c')
-rw-r--r--src/blob.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/blob.c b/src/blob.c
index 2e3c7b3b2..b8282e505 100644
--- a/src/blob.c
+++ b/src/blob.c
@@ -91,9 +91,9 @@ int git_blob_create_fromfile(git_oid *oid, git_repository *repo, const char *pat
if (repo->path_workdir == NULL)
return git__throw(GIT_ENOTFOUND, "Failed to create blob. (No working directory found)");
- git__joinpath(full_path, repo->path_workdir, path);
+ git_path_join(full_path, repo->path_workdir, path);
- error = gitfo_lstat(full_path, &st);
+ error = p_lstat(full_path, &st);
if (error < 0) {
return git__throw(GIT_EOSERR, "Failed to stat blob. %s", strerror(errno));
}
@@ -102,12 +102,12 @@ int git_blob_create_fromfile(git_oid *oid, git_repository *repo, const char *pat
size = st.st_size;
if (!islnk)
- if ((fd = gitfo_open(full_path, O_RDONLY)) < 0)
+ if ((fd = p_open(full_path, O_RDONLY)) < 0)
return git__throw(GIT_ENOTFOUND, "Failed to create blob. Could not open '%s'", full_path);
if ((error = git_odb_open_wstream(&stream, repo->db, (size_t)size, GIT_OBJ_BLOB)) < GIT_SUCCESS) {
if (!islnk)
- gitfo_close(fd);
+ p_close(fd);
return git__rethrow(error, "Failed to create blob");
}
@@ -115,13 +115,13 @@ int git_blob_create_fromfile(git_oid *oid, git_repository *repo, const char *pat
ssize_t read_len;
if (!islnk)
- read_len = gitfo_read(fd, buffer, sizeof(buffer));
+ read_len = p_read(fd, buffer, sizeof(buffer));
else
- read_len = gitfo_readlink(full_path, buffer, sizeof(buffer));
+ read_len = p_readlink(full_path, buffer, sizeof(buffer));
if (read_len < 0) {
if (!islnk)
- gitfo_close(fd);
+ p_close(fd);
stream->free(stream);
return git__throw(GIT_EOSERR, "Failed to create blob. Can't read full file");
}
@@ -133,7 +133,7 @@ int git_blob_create_fromfile(git_oid *oid, git_repository *repo, const char *pat
error = stream->finalize_write(oid, stream);
stream->free(stream);
if (!islnk)
- gitfo_close(fd);
+ p_close(fd);
return error == GIT_SUCCESS ? GIT_SUCCESS : git__rethrow(error, "Failed to create blob");
}