Commit 0978f4ba authored by Michael Haggerty's avatar Michael Haggerty Committed by Junio C Hamano

lockfile: add a new method, is_lock_file_locked()

It will soon prove useful.
Signed-off-by: default avatarMichael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
parent 64da4199
......@@ -175,6 +175,14 @@ static inline int hold_lock_file_for_update(
return hold_lock_file_for_update_timeout(lk, path, flags, 0);
}
/*
* Return a nonzero value iff `lk` is currently locked.
*/
static inline int is_lock_file_locked(struct lock_file *lk)
{
return is_tempfile_active(&lk->tempfile);
}
/*
* Append an appropriate error message to `buf` following the failure
* of `hold_lock_file_for_update()` to lock `path`. `err` should be the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment