Skip to content

Commit 6594883

Browse files
pcloudsgitster
authored andcommitted
wrapper.c: delete dead function git_mkstemps()
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 423b592 commit 6594883

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

cache.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -926,8 +926,6 @@ static inline int is_empty_blob_sha1(const unsigned char *sha1)
926926

927927
int git_mkstemp(char *path, size_t n, const char *template);
928928

929-
int git_mkstemps(char *path, size_t n, const char *template, int suffix_len);
930-
931929
/* set default permissions by passing mode arguments to open(2) */
932930
int git_mkstemps_mode(char *pattern, int suffix_len, int mode);
933931
int git_mkstemp_mode(char *pattern, int mode);

wrapper.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -446,23 +446,6 @@ int git_mkstemp(char *path, size_t len, const char *template)
446446
return mkstemp(path);
447447
}
448448

449-
/* git_mkstemps() - create tmp file with suffix honoring TMPDIR variable. */
450-
int git_mkstemps(char *path, size_t len, const char *template, int suffix_len)
451-
{
452-
const char *tmp;
453-
size_t n;
454-
455-
tmp = getenv("TMPDIR");
456-
if (!tmp)
457-
tmp = "/tmp";
458-
n = snprintf(path, len, "%s/%s", tmp, template);
459-
if (len <= n) {
460-
errno = ENAMETOOLONG;
461-
return -1;
462-
}
463-
return mkstemps(path, suffix_len);
464-
}
465-
466449
/* Adapted from libiberty's mkstemp.c. */
467450

468451
#undef TMP_MAX

0 commit comments

Comments
 (0)