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

[PATCH 2/2] wrapper.c: delete dead function git_mkstemps()

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Apr 22, 2016, 12:25 UTC
Message-ID
<1461327916-3575-2-git-send-email-pclouds@gmail.com>
In-Reply-To
<1461327916-3575-1-git-send-email-pclouds@gmail.com>

Its last call site was replaced by mks_tempfile_ts() in 284098f (diff: use tempfile module - 2015-08-12) and there's a good chance mks_tempfile_ts will continue to successfully handle this job. Delete it.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 cache.h   |  2 --
 wrapper.c | 17 -----------------
 2 files changed, 19 deletions(-)
diff --git a/cache.h b/cache.h
index 2711048..fd728f0 100644
--- a/cache.h
+++ b/cache.h
@@ -958,8 +958,6 @@ static inline int is_empty_blob_sha1(const unsigned char *sha1)
 
 int git_mkstemp(char *path, size_t n, const char *template);
 
-int git_mkstemps(char *path, size_t n, const char *template, int suffix_len);
-
 /* set default permissions by passing mode arguments to open(2) */
 int git_mkstemps_mode(char *pattern, int suffix_len, int mode);
 int git_mkstemp_mode(char *pattern, int mode);
diff --git a/wrapper.c b/wrapper.c
index 9afc1a0..9009f8b 100644
--- a/wrapper.c
+++ b/wrapper.c
@@ -446,23 +446,6 @@ int git_mkstemp(char *path, size_t len, const char *template)
 	return mkstemp(path);
 }
 
-/* git_mkstemps() - create tmp file with suffix honoring TMPDIR variable. */
-int git_mkstemps(char *path, size_t len, const char *template, int suffix_len)
-{
-	const char *tmp;
-	size_t n;
-
-	tmp = getenv("TMPDIR");
-	if (!tmp)
-		tmp = "/tmp";
-	n = snprintf(path, len, "%s/%s", tmp, template);
-	if (len <= n) {
-		errno = ENAMETOOLONG;
-		return -1;
-	}
-	return mkstemps(path, suffix_len);
-}
-
 /* Adapted from libiberty's mkstemp.c. */
 
 #undef TMP_MAX
-- 
2.8.0.rc0.210.gd302cd2
Previous: Nguyễn Thái Ngọc Duy
Message 2 of 2 in “dir.c: remove dead function fnmatch_icase()”
  1. 1/2 dir.c: remove dead function fnmatch_icase()Nguyễn Thái Ngọc Duy, Apr 22, 2016
  2. 2/2 wrapper.c: delete dead function git_mkstemps()Nguyễn Thái Ngọc Duy, Apr 22, 2016

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.