diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2014-10-01 13:14:49 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-10-01 14:20:25 -0700 |
commit | 6e578a31e6662c69107eb4587d1024dd9f38cc3c (patch) | |
tree | 5d2e5a0192137902798d560c3fee4184af52d0b0 /refs.c | |
parent | f70f0565b3a905ba90af3446475afec2e8aa0d2a (diff) | |
download | git-6e578a31e6662c69107eb4587d1024dd9f38cc3c.tar.gz |
commit_packed_refs(): reimplement using fdopen_lock_file()mh/lockfile-stdio
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -2309,16 +2309,13 @@ int commit_packed_refs(void) if (!packed_ref_cache->lock) die("internal error: packed-refs not locked"); - out = fdopen(packed_ref_cache->lock->fd, "w"); + out = fdopen_lock_file(packed_ref_cache->lock, "w"); if (!out) die_errno("unable to fdopen packed-refs descriptor"); fprintf_or_die(out, "%s", PACKED_REFS_HEADER); do_for_each_entry_in_dir(get_packed_ref_dir(packed_ref_cache), 0, write_packed_entry_fn, out); - if (fclose(out)) - die_errno("write error"); - packed_ref_cache->lock->fd = -1; if (commit_lock_file(packed_ref_cache->lock)) { save_errno = errno; |