Re: fix potential deadlock in create_one_file
- From
Junio C Hamano <junkio@cox.net>
- Date
- Jan 6, 2006, 22:38 UTC
- Message-ID
- <7vpsn5q8x6.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <81b0412b0601050100v519e76c8u11f4d484f9d28e0a@mail.gmail.com>
Alex Riesen <raa.lkml@gmail.com> writes:
> It can happen if the temporary file already exists (i.e. after a panic > and reboot).
We use pid here and using somebody else's pid feels wrong but that is only for collision avoidance, mktemp(3) is no better, and neither tmpfile(3) nor mkstemp(3) are usable for directories anyway, so your patch as is would be the best solution.
Thanks.