git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jakub Narebski <jnareb@gmail.com>
Date
May 27, 2009, 08:20 UTC
Message-ID
<m33aarc5yc.fsf@localhost.localdomain>
In-Reply-To
<1243394364-13772-1-git-send-email-davvid@gmail.com>
David Aguilar <davvid@gmail.com> writes:
Show 14 quoted lines
> mkstemps() is a BSD extension so provide an implementation
> for cross-platform use.
> 
> Signed-off-by: David Aguilar <davvid@gmail.com>
> ---
> 
> 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
Previous: Johannes Sixt
Message 8 of 8 in “compat: add a mkstemps() compatibility function”
  1. 1/2 compat: add a mkstemps() compatibility functionDavid Aguilar, May 27, 2009
  2. 2/2 diff: generate prettier filenames when using GIT_EXTERNAL_DIFFDavid Aguilar, May 27, 2009
  3. David AguilarMay 27, 2009
  4. Johannes SixtMay 27, 2009
  5. David AguilarMay 27, 2009
  6. David AguilarMay 27, 2009
  7. Johannes SixtMay 27, 2009
  8. Jakub NarebskiMay 27, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.