Commit b933c14a by Edward Thomson

util: remove `p_mktemp` / `p_mkstemp`

We have our own temporary file creation function now in
`git_futils_mktmp`, remove the others since they may be terrible on some
platforms.
parent 97fade4f
......@@ -131,7 +131,6 @@ extern ssize_t p_pwrite(int fd, const void *data, size_t size, off64_t offset);
#define p_close(fd) close(fd)
#define p_umask(m) umask(m)
#define p_mktemp(p) mktemp(p)
extern int p_open(const char *path, int flags, ...);
extern int p_creat(const char *path, mode_t mode);
......
......@@ -58,7 +58,6 @@ GIT_INLINE(int) p_fsync(int fd)
#define p_strncasecmp(s1, s2, c) strncasecmp(s1, s2, c)
#define p_vsnprintf(b, c, f, a) vsnprintf(b, c, f, a)
#define p_snprintf snprintf
#define p_mkstemp(p) mkstemp(p)
#define p_chdir(p) chdir(p)
#define p_rmdir(p) rmdir(p)
#define p_access(p,m) access(p,m)
......
......@@ -42,7 +42,6 @@ extern int p_inet_pton(int af, const char *src, void* dst);
extern int p_vsnprintf(char *buffer, size_t count, const char *format, va_list argptr);
extern int p_snprintf(char *buffer, size_t count, const char *format, ...) GIT_FORMAT_PRINTF(3, 4);
extern int p_mkstemp(char *tmp_path);
extern int p_chdir(const char *path);
extern int p_chmod(const char *path, mode_t mode);
extern int p_rmdir(const char *path);
......
......@@ -860,20 +860,6 @@ int p_snprintf(char *buffer, size_t count, const char *format, ...)
return r;
}
/* TODO: wut? */
int p_mkstemp(char *tmp_path)
{
#if defined(_MSC_VER) && _MSC_VER >= 1500
if (_mktemp_s(tmp_path, strlen(tmp_path) + 1) != 0)
return -1;
#else
if (_mktemp(tmp_path) == NULL)
return -1;
#endif
return p_open(tmp_path, O_RDWR | O_CREAT | O_EXCL, 0744); /* -V536 */
}
int p_access(const char *path, mode_t mode)
{
git_win32_path buf;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment