From: Joel Rosdahl Date: Thu, 3 Dec 2020 20:46:31 +0000 (+0100) Subject: Remove legacy “cheap and nasty” mkstemp replacement X-Git-Tag: v4.2~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=899a1025c287c57df25ac638d159fc03f075fd3f;p=thirdparty%2Fccache.git Remove legacy “cheap and nasty” mkstemp replacement Hopefully mkstemp is available on all systems we want to support these days. As mentioned in #703. --- diff --git a/cmake/GenerateConfigurationFile.cmake b/cmake/GenerateConfigurationFile.cmake index a21861f4a..2d1125a26 100644 --- a/cmake/GenerateConfigurationFile.cmake +++ b/cmake/GenerateConfigurationFile.cmake @@ -30,7 +30,6 @@ set(functions getopt_long getpwuid gettimeofday - mkstemp posix_fallocate realpath setenv diff --git a/cmake/config.h.in b/cmake/config.h.in index 28a070647..be65c0a95 100644 --- a/cmake/config.h.in +++ b/cmake/config.h.in @@ -83,9 +83,6 @@ // Define if the system has the type "long long". #cmakedefine HAVE_LONG_LONG -// Define if you have the "mkstemp" function. -#cmakedefine HAVE_MKSTEMP - // Define if you have the "posix_fallocate. #cmakedefine HAVE_POSIX_FALLOCATE diff --git a/src/TemporaryFile.cpp b/src/TemporaryFile.cpp index 0c64f5ec3..11fd8ba1b 100644 --- a/src/TemporaryFile.cpp +++ b/src/TemporaryFile.cpp @@ -39,23 +39,6 @@ get_umask() } #endif -#ifndef HAVE_MKSTEMP -// Cheap and nasty mkstemp replacement. -int -mkstemp(char* name_template) -{ -# ifdef __GNUC__ -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wdeprecated-declarations" -# endif - mktemp(name_template); -# ifdef __GNUC__ -# pragma GCC diagnostic pop -# endif - return open(name_template, O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0600); -} -#endif - } // namespace TemporaryFile::TemporaryFile(string_view path_prefix)