mirror of
https://github.com/git/git.git
synced 2024-10-28 12:59:41 +01:00
lockfile: add a new method, is_lock_file_locked()
It will soon prove useful. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
64da41993a
commit
0978f4ba7f
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue