From: "René Scharfe" <l.s.r@web•de>
To: Git List <git@vger•kernel.org>
Cc: Jeff King <peff@peff•net>, Chris Torek <chris.torek@gmail•com>,
Junio C Hamano <gitster@pobox•com>
Subject: [PATCH v2 5/5] compat: remove gitmkdtemp()
Date: Sat, 6 Dec 2025 14:35:39 +0100 [thread overview]
Message-ID: <b0ed5848-ab28-4255-9933-b1d15ac9e13c@web.de> (raw)
In-Reply-To: <64e62623-b911-4ddd-a481-05191853c0a6@web.de>
gitmkdtemp() has become a trivial wrapper around git_mkdtemp(). Remove
this now unnecessary layer of indirection.
Signed-off-by: René Scharfe <l.s.r@web•de>
---
Only tested with make.
Makefile | 1 -
compat/mkdtemp.c | 6 ------
compat/posix.h | 3 +--
contrib/buildsystems/CMakeLists.txt | 4 ----
meson.build | 2 +-
5 files changed, 2 insertions(+), 14 deletions(-)
delete mode 100644 compat/mkdtemp.c
diff --git a/Makefile b/Makefile
index 237b56fc9d..8226aed443 100644
--- a/Makefile
+++ b/Makefile
@@ -1919,7 +1919,6 @@ ifdef NO_SETENV
endif
ifdef NO_MKDTEMP
COMPAT_CFLAGS += -DNO_MKDTEMP
- COMPAT_OBJS += compat/mkdtemp.o
endif
ifdef MKDIR_WO_TRAILING_SLASH
COMPAT_CFLAGS += -DMKDIR_WO_TRAILING_SLASH
diff --git a/compat/mkdtemp.c b/compat/mkdtemp.c
deleted file mode 100644
index fcdd4e01e1..0000000000
--- a/compat/mkdtemp.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "../git-compat-util.h"
-
-char *gitmkdtemp(char *template)
-{
- return git_mkdtemp(template);
-}
diff --git a/compat/posix.h b/compat/posix.h
index 067a00f33b..245386fa4a 100644
--- a/compat/posix.h
+++ b/compat/posix.h
@@ -329,8 +329,7 @@ int gitsetenv(const char *, const char *, int);
#endif
#ifdef NO_MKDTEMP
-#define mkdtemp gitmkdtemp
-char *gitmkdtemp(char *);
+#define mkdtemp git_mkdtemp
#endif
#ifdef NO_UNSETENV
diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt
index 479163ab5c..28877feb9d 100644
--- a/contrib/buildsystems/CMakeLists.txt
+++ b/contrib/buildsystems/CMakeLists.txt
@@ -411,10 +411,6 @@ if(NOT HAVE_SETENV)
list(APPEND compat_SOURCES compat/setenv.c)
endif()
-if(NOT HAVE_MKDTEMP)
- list(APPEND compat_SOURCES compat/mkdtemp.c)
-endif()
-
if(NOT HAVE_PREAD)
list(APPEND compat_SOURCES compat/pread.c)
endif()
diff --git a/meson.build b/meson.build
index f1b3615659..24c656681c 100644
--- a/meson.build
+++ b/meson.build
@@ -1401,7 +1401,7 @@ checkfuncs = {
'strlcpy' : ['strlcpy.c'],
'strtoull' : [],
'setenv' : ['setenv.c'],
- 'mkdtemp' : ['mkdtemp.c'],
+ 'mkdtemp' : [],
'initgroups' : [],
'strtoumax' : ['strtoumax.c', 'strtoimax.c'],
'pread' : ['pread.c'],
--
2.52.0
next prev parent reply other threads:[~2025-12-06 13:35 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-03 10:45 [PATCH 0/4] ban mktemp(3) René Scharfe
2025-12-03 10:51 ` [PATCH 1/4] wrapper: add git_mkdtemp() René Scharfe
2025-12-04 11:51 ` Chris Torek
2025-12-05 23:05 ` Junio C Hamano
2025-12-03 10:52 ` [PATCH 2/4] compat: use git_mkdtemp() René Scharfe
2025-12-03 16:11 ` Jeff King
2025-12-05 12:11 ` René Scharfe
2025-12-06 2:11 ` Jeff King
2025-12-05 23:05 ` Junio C Hamano
2025-12-03 10:52 ` [PATCH 3/4] compat: remove mingw_mktemp() René Scharfe
2025-12-03 10:53 ` [PATCH 4/4] banned.h: ban mktemp(3) René Scharfe
2025-12-03 16:12 ` Jeff King
2025-12-06 13:21 ` [PATCH v2 0/5] " René Scharfe
2025-12-06 13:27 ` [PATCH v2 1/5] wrapper: add git_mkdtemp() René Scharfe
2025-12-06 13:27 ` [PATCH v2 2/5] compat: use git_mkdtemp() René Scharfe
2025-12-06 13:28 ` [PATCH v2 3/5] compat: remove mingw_mktemp() René Scharfe
2025-12-06 13:29 ` [PATCH v2 4/5] banned.h: ban mktemp(3) René Scharfe
2025-12-06 13:35 ` René Scharfe [this message]
2025-12-08 20:33 ` [PATCH v2 0/5] " Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b0ed5848-ab28-4255-9933-b1d15ac9e13c@web.de \
--to=l.s.r@web$(echo .)de \
--cc=chris.torek@gmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
--cc=peff@peff$(echo .)net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox