]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Remove legacy “cheap and nasty” mkstemp replacement
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 3 Dec 2020 20:46:31 +0000 (21:46 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 6 Dec 2020 07:59:37 +0000 (08:59 +0100)
Hopefully mkstemp is available on all systems we want to support these
days.

As mentioned in #703.

cmake/GenerateConfigurationFile.cmake
cmake/config.h.in
src/TemporaryFile.cpp

index a21861f4a3d5aeb8b775f02797cc24957e6754ca..2d1125a260ceddd312631e5205fcdd39ef6d0af0 100644 (file)
@@ -30,7 +30,6 @@ set(functions
     getopt_long
     getpwuid
     gettimeofday
-    mkstemp
     posix_fallocate
     realpath
     setenv
index 28a070647d245891d783b84bfa24ce22be261fcc..be65c0a9577c9773ee857f4c74259dbcddd7b4dd 100644 (file)
@@ -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
 
index 0c64f5ec3de8ddca44863dd802187c88082159cd..11fd8ba1beeefe62680cb84291da08f2100175c1 100644 (file)
@@ -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)