From e48855bdd2fc57fc51156f5e4b8dee6b544456c8 Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Thu, 4 Aug 2016 14:30:13 +1000 Subject: (perl #127663) add our own mkstemp() implementation Needed to generate temp files for safer in-place editing. Not based on any particular implementation, the BSD implementations tend to be wrappers around a megafunction that also does a few variations of mkstemp() and mkdtemp(), which we don't need (yet.) This might also be useful as a replacement for broken mkstemp() implementations that use a mode of 0666 when creating the file, though we'd need to add Configure probing for that. --- util.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'util.h') diff --git a/util.h b/util.h index 4589808ee1..6b63d90e4f 100644 --- a/util.h +++ b/util.h @@ -246,6 +246,10 @@ means arg not present, 1 is empty string/null byte */ ((char *) memmem(big, bigend - big, little, lend - little)) #endif +#if defined(HAS_MKSTEMP) && defined(PERL_CORE) +# define Perl_my_mkstemp(templte) mkstemp(templte) +#endif + #endif /* PERL_UTIL_H_ */ /* -- cgit v1.2.1