Re: [PATCH 03/20] raceproof_create_file(): new function

2016-02-17 Thread Junio C Hamano
Michael Haggerty writes: > I was thinking about moving this function, along with > safe_create_leading_directories() and > safe_create_leading_directories_const(), to a more general module like > path.c. But it didn't seem worth the code churn. I think it would be a better longer-term endgame st

[PATCH 03/20] raceproof_create_file(): new function

2016-02-16 Thread Michael Haggerty
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