diff options
| author | Junio C Hamano <gitster@pobox.com> | 2014-10-14 10:49:51 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2014-10-14 10:49:52 -0700 |
| commit | 11cb3130d551590ae2dbd582e809763bfc353a47 (patch) | |
| tree | 6edf0266faf83489cbda960831e80a5e5384bea1 /lockfile.h | |
| parent | bd107e1052a11cf7dd6baf9077eab52fbb9d9c90 (diff) | |
| parent | 6e578a31e6662c69107eb4587d1024dd9f38cc3c (diff) | |
| download | git-11cb3130d551590ae2dbd582e809763bfc353a47.tar.xz | |
Merge branch 'mh/lockfile-stdio'
* mh/lockfile-stdio:
commit_packed_refs(): reimplement using fdopen_lock_file()
dump_marks(): reimplement using fdopen_lock_file()
fdopen_lock_file(): access a lockfile using stdio
Diffstat (limited to 'lockfile.h')
| -rw-r--r-- | lockfile.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lockfile.h b/lockfile.h index 9059e8958f..dc066d1783 100644 --- a/lockfile.h +++ b/lockfile.h @@ -34,6 +34,8 @@ * - active is set * - filename holds the filename of the lockfile * - fd holds a file descriptor open for writing to the lockfile + * - fp holds a pointer to an open FILE object if and only if + * fdopen_lock_file() has been called on the object * - owner holds the PID of the process that locked the file * * - Locked, lockfile closed (after successful close_lock_file()). @@ -56,6 +58,7 @@ struct lock_file { struct lock_file *volatile next; volatile sig_atomic_t active; volatile int fd; + FILE *volatile fp; volatile pid_t owner; char on_list; struct strbuf filename; @@ -74,6 +77,7 @@ extern void unable_to_lock_message(const char *path, int err, extern NORETURN void unable_to_lock_die(const char *path, int err); extern int hold_lock_file_for_update(struct lock_file *, const char *path, int); extern int hold_lock_file_for_append(struct lock_file *, const char *path, int); +extern FILE *fdopen_lock_file(struct lock_file *, const char *mode); extern char *get_locked_file_path(struct lock_file *); extern int commit_lock_file_to(struct lock_file *, const char *path); extern int commit_lock_file(struct lock_file *); |
