MCPcopy Create free account
hub / github.com/git/git / close_lock_file_gently

Function close_lock_file_gently

lockfile.h:287–290  ·  view source on GitHub ↗

* If the lockfile is still open, close it (and the file pointer if it * has been opened using `fdopen_lock_file()`) without renaming the * lockfile over the file being locked. Return 0 upon success. On * failure to `close(2)`, return a negative value (the lockfile is not * rolled back). Usually `commit_lock_file()`, `commit_lock_file_to()`, * or `rollback_lock_file()` should eventually be cal

Source from the content-addressed store, hash-verified

285 * or `rollback_lock_file()` should eventually be called.
286 */
287static inline int close_lock_file_gently(struct lock_file *lk)
288{
289 return close_tempfile_gently(lk->tempfile);
290}
291
292/*
293 * Re-open a lockfile that has been closed using `close_lock_file_gently()`

Callers 5

do_write_locked_indexFunction · 0.85
flock_closeFunction · 0.85
packed_refs_lockFunction · 0.85
close_ref_gentlyFunction · 0.85
files_reflog_expireFunction · 0.85

Calls 1

close_tempfile_gentlyFunction · 0.85

Tested by

no test coverage detected