MCPcopy Index your code
hub / github.com/git/git / close_tempfile_gently

Function close_tempfile_gently

tempfile.c:298–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296}
297
298int close_tempfile_gently(struct tempfile *tempfile)
299{
300 int fd;
301 FILE *fp;
302 int err;
303
304 if (!is_tempfile_active(tempfile) || tempfile->fd < 0)
305 return 0;
306
307 fd = tempfile->fd;
308 fp = tempfile->fp;
309 tempfile->fd = -1;
310 if (fp) {
311 tempfile->fp = NULL;
312 if (ferror(fp)) {
313 err = -1;
314 if (!fclose(fp))
315 errno = EIO;
316 } else {
317 err = fclose(fp);
318 }
319 } else {
320 err = close(fd);
321 }
322
323 return err ? -1 : 0;
324}
325
326int reopen_tempfile(struct tempfile *tempfile)
327{

Callers 13

rename_tempfileFunction · 0.85
delete_tempfileFunction · 0.85
close_lock_file_gentlyFunction · 0.85
setup_temporary_shallowFunction · 0.85
prep_temp_blobFunction · 0.85
do_write_indexFunction · 0.85
verify_gpg_signed_bufferFunction · 0.85
verify_ssh_signed_bufferFunction · 0.85
sign_buffer_sshFunction · 0.85
midx_snapshot_refsFunction · 0.85
tmpfile_closeFunction · 0.85
write_with_updatesFunction · 0.85

Calls 1

is_tempfile_activeFunction · 0.85

Tested by

no test coverage detected