]> git.ipfire.org Git - thirdparty/git.git/blobdiff - lockfile.c
lockfile: add accessors get_lock_file_fd() and get_lock_file_fp()
[thirdparty/git.git] / lockfile.c
index 2369eff5411521f308cdca17b46e8856a2840374..df9c704f51d6f2147421e67a70f9f91034ebb1d2 100644 (file)
@@ -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)