diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2017-01-06 17:22:26 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-01-07 19:30:09 -0800 |
commit | 177978f56ad4723fa9dba05fe724f397a2887ca8 (patch) | |
tree | d45432d508e132b8b91e09f094baa4fd74690220 /argv-array.c | |
parent | safe_create_leading_directories(): set errno on SCLD_EXISTS (diff) | |
download | tgif-177978f56ad4723fa9dba05fe724f397a2887ca8.tar.xz |
raceproof_create_file(): new function
Add a function that tries to create a file and any containing
directories in a way that is robust against races with other processes
that might be cleaning up empty directories at the same time.
The actual file creation is done by a callback function, which, if it
fails, should set errno to EISDIR or ENOENT according to the convention
of open(). raceproof_create_file() detects such failures, and
respectively either tries to delete empty directories that might be in
the way of the file or tries to create the containing directories. Then
it retries the callback function.
This function is not yet used.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'argv-array.c')
0 files changed, 0 insertions, 0 deletions