Subject: Re: [PATCH 1/2] compat: add a mkstemps() compatibility function

From: Jakub Narebski <[email-masked]>
Date: Wed, 27 May 2009 01:20:55 -0700 (PDT)

David Aguilar <[email-masked]> writes:

> mkstemps() is a BSD extension so provide an implementation
> for cross-platform use.
> 
> Signed-off-by: David Aguilar <[email-masked]>
> ---
> 
> This mkstemps() implementation is adapted from libiberty's
> GPLv2+ mkstemps.c.
> 
>  Makefile          |   19 +++++++++++++
>  compat/mkstemps.c |   78 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>  git-compat-util.h |    5 +++
>  3 files changed, 102 insertions(+), 0 deletions(-)
>  create mode 100644 compat/mkstemps.c

Could you squash this in?  I see that configure.ac is a bit outdated,
but we shouldn't make it even more so...

---
 config.mak.in |    1 +
 configure.ac  |    6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/config.mak.in b/config.mak.in
index 7cce0c1..b6619af 100644
--- a/config.mak.in
+++ b/config.mak.in
@@ -46,6 +46,7 @@ NO_STRTOUMAX=@NO_STRTOUMAX@
 NO_SETENV=@NO_SETENV@
 NO_UNSETENV=@NO_UNSETENV@
 NO_MKDTEMP=@NO_MKDTEMP@
+NO_MKSTEMPS=@NO_MKSTEMPS@
 NO_ICONV=@NO_ICONV@
 OLD_ICONV=@OLD_ICONV@
 NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@
diff --git a/configure.ac b/configure.ac
index 4e728bc..2ddf498 100644
--- a/configure.ac
+++ b/configure.ac
@@ -677,6 +677,12 @@ GIT_CHECK_FUNC(mkdtemp,
 [NO_MKDTEMP=YesPlease])
 AC_SUBST(NO_MKDTEMP)
 #
+# Define NO_MKSTEMPS if you don't have mkstemps in the C library.
+GIT_CHECK_FUNC(mkstemps,
+[NO_MKSTEMPS=],
+[NO_MKSTEMPS=YesPlease])
+AC_SUBST(NO_MKSTEMPS)
+#
 # Define NO_MMAP if you want to avoid mmap.
 #
 # Define NO_ICONV if your libc does not properly support iconv.
-- 
1.6.3.1