diff options
author | Romain Geissler <romain.geissler@gmail.com> | 2011-06-03 23:18:24 +0400 |
---|---|---|
committer | Romain Geissler <romain.geissler@gmail.com> | 2011-06-04 01:08:42 +0400 |
commit | 1549cba9a4f7d9ad79441b748937bbe606ba79c1 (patch) | |
tree | 6fd6a4d881062713122f0cdf5e6fff58d4086f21 /src/filebuf.c | |
parent | bc6484912ebb3db2ac9637abebdeadd28f6d84c3 (diff) |
Filebuf: Fixed a TODO in filebuf (real lock in lock_file)
Added gitfo_creat_locked and gitfo_creat_locked_force
Diffstat (limited to 'src/filebuf.c')
-rw-r--r-- | src/filebuf.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/filebuf.c b/src/filebuf.c index 63f2897cb..97dec83f3 100644 --- a/src/filebuf.c +++ b/src/filebuf.c @@ -41,16 +41,14 @@ static int lock_file(git_filebuf *file, int flags) /* create path to the file buffer is required */ if (flags & GIT_FILEBUF_FORCE) { - file->fd = gitfo_creat_force(file->path_lock, 0644); + file->fd = gitfo_creat_locked_force(file->path_lock, 0644); } else { - file->fd = gitfo_creat(file->path_lock, 0644); + file->fd = gitfo_creat_locked(file->path_lock, 0644); } if (file->fd < 0) return git__throw(GIT_EOSERR, "Failed to create lock"); - /* TODO: do a flock() in the descriptor file_lock */ - if ((flags & GIT_FILEBUF_APPEND) && gitfo_exists(file->path_original) == 0) { git_file source; char buffer[2048]; |