From 4f0d81d30685a98ec5b1058c09be8833e7fd147f Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 10 Feb 2008 14:30:30 +0100 Subject: [PATCH] Remove para_mkstemp(). It's unused. --- string.c | 27 --------------------------- string.h | 3 +-- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/string.c b/string.c index 51461b20..eb8b12ec 100644 --- a/string.c +++ b/string.c @@ -250,33 +250,6 @@ __must_check __malloc char *para_tmpname(void) return make_message("%08i", rand()); } -/** - * Create unique temporary file. - * - * \param template The template to be passed to mkstemp(). - * \param mode The desired mode of the tempfile. - * - * This wrapper for mkstemp additionally uses fchmod() to - * set the given mode of the tempfile if mkstemp() returned success. - * - * \return The file descriptor of the temp file just created on success. - * On errors, a negative value is returned. - */ -__must_check int para_mkstemp(char *template, mode_t mode) -{ - int tmp, fd = mkstemp(template); - - if (fd < 0) - return -ERRNO_TO_PARA_ERROR(errno); - tmp = fchmod(fd, mode); - if (tmp >= 0) - return fd; - tmp = errno; - close(fd); - unlink(template); - return -ERRNO_TO_PARA_ERROR(tmp); -} - /** * Get the logname of the current user. * diff --git a/string.h b/string.h index 26e54819..84101a87 100644 --- a/string.h +++ b/string.h @@ -24,9 +24,8 @@ __must_check __malloc __printf_1_2 char *make_message(const char *fmt, ...); __must_check __malloc char *para_strcat(char *a, const char *b); __must_check __malloc char *para_dirname(const char *name); __must_check const char *para_basename(const char *name); -void chop(char* buf); +void chop(char *buf); __must_check __malloc char *para_tmpname(void); -__must_check int para_mkstemp(char *template, mode_t mode); __must_check __malloc char *para_logname(void); __must_check __malloc char *para_homedir(void); __must_check unsigned split_args(char *args, char *** const argv_ptr, const char *delim); -- 2.39.2