lockfile: add accessors get_lock_file_fd() and get_lock_file_fp()
We are about to move those members, so change client code to read them through accessor functions. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
e54c347c1c
commit
c99a4c2db3
14
lockfile.c
14
lockfile.c
@@ -364,6 +364,20 @@ FILE *fdopen_lock_file(struct lock_file *lk, const char *mode)
|
||||
return lk->fp;
|
||||
}
|
||||
|
||||
int get_lock_file_fd(struct lock_file *lk)
|
||||
{
|
||||
if (!lk->active)
|
||||
die("BUG: get_lock_file_fd() called for unlocked object");
|
||||
return lk->fd;
|
||||
}
|
||||
|
||||
FILE *get_lock_file_fp(struct lock_file *lk)
|
||||
{
|
||||
if (!lk->active)
|
||||
die("BUG: get_lock_file_fp() called for unlocked object");
|
||||
return lk->fp;
|
||||
}
|
||||
|
||||
char *get_locked_file_path(struct lock_file *lk)
|
||||
{
|
||||
if (!lk->active)
|
||||
|
||||
Reference in New Issue
Block a user