Merge branch 'rj/remove-unused-mktemp' into maint

Code cleanup.

* rj/remove-unused-mktemp:
  wrapper.c: remove unused gitmkstemps() function
  wrapper.c: remove unused git_mkstemp() function
maint
Junio C Hamano 2017-03-21 15:03:24 -07:00
commit f56a4390ee
6 changed files with 0 additions and 60 deletions

View File

@ -102,8 +102,6 @@ all::
# #
# Define MKDIR_WO_TRAILING_SLASH if your mkdir() can't deal with trailing slash. # Define MKDIR_WO_TRAILING_SLASH if your mkdir() can't deal with trailing slash.
# #
# Define NO_MKSTEMPS if you don't have mkstemps in the C library.
#
# Define NO_GECOS_IN_PWENT if you don't have pw_gecos in struct passwd # Define NO_GECOS_IN_PWENT if you don't have pw_gecos in struct passwd
# in the C library. # in the C library.
# #
@ -1280,9 +1278,6 @@ ifdef MKDIR_WO_TRAILING_SLASH
COMPAT_CFLAGS += -DMKDIR_WO_TRAILING_SLASH COMPAT_CFLAGS += -DMKDIR_WO_TRAILING_SLASH
COMPAT_OBJS += compat/mkdir.o COMPAT_OBJS += compat/mkdir.o
endif endif
ifdef NO_MKSTEMPS
COMPAT_CFLAGS += -DNO_MKSTEMPS
endif
ifdef NO_UNSETENV ifdef NO_UNSETENV
COMPAT_CFLAGS += -DNO_UNSETENV COMPAT_CFLAGS += -DNO_UNSETENV
COMPAT_OBJS += compat/unsetenv.o COMPAT_OBJS += compat/unsetenv.o

View File

@ -1045,9 +1045,6 @@ static inline int is_empty_tree_oid(const struct object_id *oid)
return !hashcmp(oid->hash, EMPTY_TREE_SHA1_BIN); return !hashcmp(oid->hash, EMPTY_TREE_SHA1_BIN);
} }



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

/* set default permissions by passing mode arguments to open(2) */ /* set default permissions by passing mode arguments to open(2) */
int git_mkstemps_mode(char *pattern, int suffix_len, int mode); int git_mkstemps_mode(char *pattern, int suffix_len, int mode);
int git_mkstemp_mode(char *pattern, int mode); int git_mkstemp_mode(char *pattern, int mode);

View File

@ -27,7 +27,6 @@ endif
ifeq ($(uname_S),Linux) ifeq ($(uname_S),Linux)
HAVE_ALLOCA_H = YesPlease HAVE_ALLOCA_H = YesPlease
NO_STRLCPY = YesPlease NO_STRLCPY = YesPlease
NO_MKSTEMPS = YesPlease
HAVE_PATHS_H = YesPlease HAVE_PATHS_H = YesPlease
LIBC_CONTAINS_LIBINTL = YesPlease LIBC_CONTAINS_LIBINTL = YesPlease
HAVE_DEV_TTY = YesPlease HAVE_DEV_TTY = YesPlease
@ -41,7 +40,6 @@ endif
ifeq ($(uname_S),GNU/kFreeBSD) ifeq ($(uname_S),GNU/kFreeBSD)
HAVE_ALLOCA_H = YesPlease HAVE_ALLOCA_H = YesPlease
NO_STRLCPY = YesPlease NO_STRLCPY = YesPlease
NO_MKSTEMPS = YesPlease
HAVE_PATHS_H = YesPlease HAVE_PATHS_H = YesPlease
DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease
LIBC_CONTAINS_LIBINTL = YesPlease LIBC_CONTAINS_LIBINTL = YesPlease
@ -55,7 +53,6 @@ ifeq ($(uname_S),UnixWare)
SHELL_PATH = /usr/local/bin/bash SHELL_PATH = /usr/local/bin/bash
NO_IPV6 = YesPlease NO_IPV6 = YesPlease
NO_HSTRERROR = YesPlease NO_HSTRERROR = YesPlease
NO_MKSTEMPS = YesPlease
BASIC_CFLAGS += -Kthread BASIC_CFLAGS += -Kthread
BASIC_CFLAGS += -I/usr/local/include BASIC_CFLAGS += -I/usr/local/include
BASIC_LDFLAGS += -L/usr/local/lib BASIC_LDFLAGS += -L/usr/local/lib
@ -79,7 +76,6 @@ ifeq ($(uname_S),SCO_SV)
SHELL_PATH = /usr/bin/bash SHELL_PATH = /usr/bin/bash
NO_IPV6 = YesPlease NO_IPV6 = YesPlease
NO_HSTRERROR = YesPlease NO_HSTRERROR = YesPlease
NO_MKSTEMPS = YesPlease
BASIC_CFLAGS += -I/usr/local/include BASIC_CFLAGS += -I/usr/local/include
BASIC_LDFLAGS += -L/usr/local/lib BASIC_LDFLAGS += -L/usr/local/lib
NO_STRCASESTR = YesPlease NO_STRCASESTR = YesPlease
@ -122,7 +118,6 @@ ifeq ($(uname_S),SunOS)
NO_STRCASESTR = YesPlease NO_STRCASESTR = YesPlease
NO_MEMMEM = YesPlease NO_MEMMEM = YesPlease
NO_MKDTEMP = YesPlease NO_MKDTEMP = YesPlease
NO_MKSTEMPS = YesPlease
NO_REGEX = YesPlease NO_REGEX = YesPlease
NO_MSGFMT_EXTENDED_OPTIONS = YesPlease NO_MSGFMT_EXTENDED_OPTIONS = YesPlease
HAVE_DEV_TTY = YesPlease HAVE_DEV_TTY = YesPlease
@ -168,7 +163,6 @@ ifeq ($(uname_O),Cygwin)
NO_D_TYPE_IN_DIRENT = YesPlease NO_D_TYPE_IN_DIRENT = YesPlease
NO_STRCASESTR = YesPlease NO_STRCASESTR = YesPlease
NO_MEMMEM = YesPlease NO_MEMMEM = YesPlease
NO_MKSTEMPS = YesPlease
NO_SYMLINK_HEAD = YesPlease NO_SYMLINK_HEAD = YesPlease
NO_IPV6 = YesPlease NO_IPV6 = YesPlease
OLD_ICONV = UnfortunatelyYes OLD_ICONV = UnfortunatelyYes
@ -233,7 +227,6 @@ ifeq ($(uname_S),NetBSD)
BASIC_CFLAGS += -I/usr/pkg/include BASIC_CFLAGS += -I/usr/pkg/include
BASIC_LDFLAGS += -L/usr/pkg/lib $(CC_LD_DYNPATH)/usr/pkg/lib BASIC_LDFLAGS += -L/usr/pkg/lib $(CC_LD_DYNPATH)/usr/pkg/lib
USE_ST_TIMESPEC = YesPlease USE_ST_TIMESPEC = YesPlease
NO_MKSTEMPS = YesPlease
HAVE_PATHS_H = YesPlease HAVE_PATHS_H = YesPlease
HAVE_BSD_SYSCTL = YesPlease HAVE_BSD_SYSCTL = YesPlease
endif endif
@ -242,7 +235,6 @@ ifeq ($(uname_S),AIX)
NO_STRCASESTR = YesPlease NO_STRCASESTR = YesPlease
NO_MEMMEM = YesPlease NO_MEMMEM = YesPlease
NO_MKDTEMP = YesPlease NO_MKDTEMP = YesPlease
NO_MKSTEMPS = YesPlease
NO_STRLCPY = YesPlease NO_STRLCPY = YesPlease
NO_NSEC = YesPlease NO_NSEC = YesPlease
FREAD_READS_DIRECTORIES = UnfortunatelyYes FREAD_READS_DIRECTORIES = UnfortunatelyYes
@ -263,7 +255,6 @@ ifeq ($(uname_S),GNU)
# GNU/Hurd # GNU/Hurd
HAVE_ALLOCA_H = YesPlease HAVE_ALLOCA_H = YesPlease
NO_STRLCPY = YesPlease NO_STRLCPY = YesPlease
NO_MKSTEMPS = YesPlease
HAVE_PATHS_H = YesPlease HAVE_PATHS_H = YesPlease
LIBC_CONTAINS_LIBINTL = YesPlease LIBC_CONTAINS_LIBINTL = YesPlease
endif endif
@ -272,7 +263,6 @@ ifeq ($(uname_S),IRIX)
NO_UNSETENV = YesPlease NO_UNSETENV = YesPlease
NO_STRCASESTR = YesPlease NO_STRCASESTR = YesPlease
NO_MEMMEM = YesPlease NO_MEMMEM = YesPlease
NO_MKSTEMPS = YesPlease
NO_MKDTEMP = YesPlease NO_MKDTEMP = YesPlease
# When compiled with the MIPSpro 7.4.4m compiler, and without pthreads # When compiled with the MIPSpro 7.4.4m compiler, and without pthreads
# (i.e. NO_PTHREADS is set), and _with_ MMAP (i.e. NO_MMAP is not set), # (i.e. NO_PTHREADS is set), and _with_ MMAP (i.e. NO_MMAP is not set),
@ -291,7 +281,6 @@ ifeq ($(uname_S),IRIX64)
NO_UNSETENV = YesPlease NO_UNSETENV = YesPlease
NO_STRCASESTR = YesPlease NO_STRCASESTR = YesPlease
NO_MEMMEM = YesPlease NO_MEMMEM = YesPlease
NO_MKSTEMPS = YesPlease
NO_MKDTEMP = YesPlease NO_MKDTEMP = YesPlease
# When compiled with the MIPSpro 7.4.4m compiler, and without pthreads # When compiled with the MIPSpro 7.4.4m compiler, and without pthreads
# (i.e. NO_PTHREADS is set), and _with_ MMAP (i.e. NO_MMAP is not set), # (i.e. NO_PTHREADS is set), and _with_ MMAP (i.e. NO_MMAP is not set),
@ -311,7 +300,6 @@ ifeq ($(uname_S),HP-UX)
NO_SETENV = YesPlease NO_SETENV = YesPlease
NO_STRCASESTR = YesPlease NO_STRCASESTR = YesPlease
NO_MEMMEM = YesPlease NO_MEMMEM = YesPlease
NO_MKSTEMPS = YesPlease
NO_STRLCPY = YesPlease NO_STRLCPY = YesPlease
NO_MKDTEMP = YesPlease NO_MKDTEMP = YesPlease
NO_UNSETENV = YesPlease NO_UNSETENV = YesPlease
@ -352,7 +340,6 @@ ifeq ($(uname_S),Windows)
NO_ICONV = YesPlease NO_ICONV = YesPlease
NO_STRTOUMAX = YesPlease NO_STRTOUMAX = YesPlease
NO_MKDTEMP = YesPlease NO_MKDTEMP = YesPlease
NO_MKSTEMPS = YesPlease
SNPRINTF_RETURNS_BOGUS = YesPlease SNPRINTF_RETURNS_BOGUS = YesPlease
NO_SVN_TESTS = YesPlease NO_SVN_TESTS = YesPlease
RUNTIME_PREFIX = YesPlease RUNTIME_PREFIX = YesPlease
@ -402,7 +389,6 @@ ifeq ($(uname_S),Interix)
NO_MKDTEMP = YesPlease NO_MKDTEMP = YesPlease
NO_STRTOUMAX = YesPlease NO_STRTOUMAX = YesPlease
NO_NSEC = YesPlease NO_NSEC = YesPlease
NO_MKSTEMPS = YesPlease
ifeq ($(uname_R),3.5) ifeq ($(uname_R),3.5)
NO_INET_NTOP = YesPlease NO_INET_NTOP = YesPlease
NO_INET_PTON = YesPlease NO_INET_PTON = YesPlease
@ -461,7 +447,6 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
NO_SETENV = YesPlease NO_SETENV = YesPlease
NO_UNSETENV = YesPlease NO_UNSETENV = YesPlease
NO_MKDTEMP = YesPlease NO_MKDTEMP = YesPlease
NO_MKSTEMPS = YesPlease
# Currently libiconv-1.9.1. # Currently libiconv-1.9.1.
OLD_ICONV = UnfortunatelyYes OLD_ICONV = UnfortunatelyYes
NO_REGEX = YesPlease NO_REGEX = YesPlease
@ -503,7 +488,6 @@ ifneq (,$(findstring MINGW,$(uname_S)))
NEEDS_LIBICONV = YesPlease NEEDS_LIBICONV = YesPlease
NO_STRTOUMAX = YesPlease NO_STRTOUMAX = YesPlease
NO_MKDTEMP = YesPlease NO_MKDTEMP = YesPlease
NO_MKSTEMPS = YesPlease
NO_SVN_TESTS = YesPlease NO_SVN_TESTS = YesPlease
NO_PERL_MAKEMAKER = YesPlease NO_PERL_MAKEMAKER = YesPlease
RUNTIME_PREFIX = YesPlease RUNTIME_PREFIX = YesPlease
@ -583,7 +567,6 @@ ifeq ($(uname_S),QNX)
NO_ICONV = YesPlease NO_ICONV = YesPlease
NO_MEMMEM = YesPlease NO_MEMMEM = YesPlease
NO_MKDTEMP = YesPlease NO_MKDTEMP = YesPlease
NO_MKSTEMPS = YesPlease
NO_NSEC = YesPlease NO_NSEC = YesPlease
NO_PTHREADS = YesPlease NO_PTHREADS = YesPlease
NO_R_TO_GCC_LINKER = YesPlease NO_R_TO_GCC_LINKER = YesPlease

View File

@ -1050,12 +1050,6 @@ GIT_CHECK_FUNC(mkdtemp,
[NO_MKDTEMP=YesPlease]) [NO_MKDTEMP=YesPlease])
GIT_CONF_SUBST([NO_MKDTEMP]) GIT_CONF_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])
GIT_CONF_SUBST([NO_MKSTEMPS])
#
# Define NO_INITGROUPS if you don't have initgroups in the C library. # Define NO_INITGROUPS if you don't have initgroups in the C library.
GIT_CHECK_FUNC(initgroups, GIT_CHECK_FUNC(initgroups,
[NO_INITGROUPS=], [NO_INITGROUPS=],

View File

@ -639,11 +639,6 @@ extern int gitsetenv(const char *, const char *, int);
extern char *gitmkdtemp(char *); extern char *gitmkdtemp(char *);
#endif #endif


#ifdef NO_MKSTEMPS
#define mkstemps gitmkstemps
extern int gitmkstemps(char *, int);
#endif

#ifdef NO_UNSETENV #ifdef NO_UNSETENV
#define unsetenv gitunsetenv #define unsetenv gitunsetenv
extern void gitunsetenv(const char *); extern void gitunsetenv(const char *);

View File

@ -440,23 +440,6 @@ int xmkstemp(char *template)
return fd; return fd;
} }


/* git_mkstemp() - create tmp file honoring TMPDIR variable */
int git_mkstemp(char *path, size_t len, const char *template)
{
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 mkstemp(path);
}

/* Adapted from libiberty's mkstemp.c. */ /* Adapted from libiberty's mkstemp.c. */


#undef TMP_MAX #undef TMP_MAX
@ -531,13 +514,6 @@ int git_mkstemp_mode(char *pattern, int mode)
return git_mkstemps_mode(pattern, 0, mode); return git_mkstemps_mode(pattern, 0, mode);
} }


#ifdef NO_MKSTEMPS
int gitmkstemps(char *pattern, int suffix_len)
{
return git_mkstemps_mode(pattern, suffix_len, 0600);
}
#endif

int xmkstemp_mode(char *template, int mode) int xmkstemp_mode(char *template, int mode)
{ {
int fd; int fd;