]> git.ipfire.org Git - thirdparty/git.git/commit - tempfile.c
register_tempfile(): new function to handle an existing temporary file
authorMichael Haggerty <mhagger@alum.mit.edu>
Mon, 10 Aug 2015 09:47:44 +0000 (11:47 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Aug 2015 19:57:14 +0000 (12:57 -0700)
commit99397152a345011c99497b93f8518c7981e811a5
tree94413563c2fcdfa2ccbcfd38ca29a3e4e3a2620d
parent354ab1120665f691c17b21fdb04c4362c8088dfa
register_tempfile(): new function to handle an existing temporary file

Allow an existing file to be registered with the tempfile-handling
infrastructure; in particular, arrange for it to be deleted on program
exit. This can be used if the temporary file has to be created in a
more complicated way than just open(). For example:

* If the file itself needs to be created via the lockfile API
* If it is not a regular file (e.g., a socket)

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
tempfile.c
tempfile.h