rollback_lock_file(): set fd to -1
commit26f5d3b65fa1b40be570a67f1aaca0e2f085d568
authorMichael Haggerty <mhagger@alum.mit.edu>
Wed, 1 Oct 2014 10:28:10 +0000 (1 12:28 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Oct 2014 20:38:41 +0000 (1 13:38 -0700)
tree3bf0c8501b1b576ef8a3dd57b1cd1d6141b660bf
parent9085f8e279146a31ea8bbd102b6c97f5cb22dcdc
rollback_lock_file(): set fd to -1

When rolling back the lockfile, call close_lock_file() so that the
lock_file's fd field gets set back to -1. This keeps the lock_file
object in a valid state, which is important because these objects are
allowed to be reused. It also makes it unnecessary to check whether
the file has already been closed, because close_lock_file() takes care
of that.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
lockfile.c