Re: [PATCH] wrapper: simplify xmkstemp()
- From
René Scharfe <l.s.r@web.de>
- Date
- Nov 22, 2025, 13:29 UTC
- Message-ID
- <18a0a729-d77c-4f4d-9581-b102bd66816c@web.de>
- In-Reply-To
- <xmqqbjkwahu1.fsf@gitster.g>
On 11/20/25 3:39 PM, Junio C Hamano wrote:
Show 11 quoted lines
> Jeff King <peff@peff.net> writes: > >>>> +#define mkstemp(template) git_mkstemp_mode((template), 0600) >> >> So this patch implements what I was thinking, though I probably would >> have made it more explicit: add mkstemp() to the banned list (not >> because it's evil but because it's unportable) and force callers to use >> git_mkstemp_mode() explicitly. > > Because only a very small number (one?) of callers call mkstemp() > in the current code, the above is probably a good thing to do.
True, banning mkstemp(3) instead of overriding it would simplify the code by removing one layer of indirection, and the hassle of no longer being able to use that standard function would be low.
René