51f0aa
commit cfa8054fbb6212e64d54a3d4926972a6a20e3498
51f0aa
Author: Andreas Schwab <schwab@suse.de>
51f0aa
Date:   Tue Jan 15 14:36:09 2013 +0100
51f0aa
51f0aa
    Hide reference to mktemp in libpthread
51f0aa
51f0aa
diff --git a/include/stdlib.h b/include/stdlib.h
51f0aa
index 152c12fe9cb41509..edec46fa1ff4cc28 100644
51f0aa
--- a/include/stdlib.h
51f0aa
+++ b/include/stdlib.h
51f0aa
@@ -78,6 +78,7 @@ extern struct drand48_data __libc_drand48_data attribute_hidden;
51f0aa
 extern int __setenv (const char *__name, const char *__value, int __replace);
51f0aa
 extern int __unsetenv (const char *__name);
51f0aa
 extern int __clearenv (void);
51f0aa
+extern char *__mktemp (char *__template) __THROW __nonnull ((1));
51f0aa
 extern char *__canonicalize_file_name (const char *__name);
51f0aa
 extern char *__realpath (const char *__name, char *__resolved);
51f0aa
 extern int __ptsname_r (int __fd, char *__buf, size_t __buflen);
51f0aa
diff --git a/misc/Versions b/misc/Versions
51f0aa
index 64632f0bfa81b00a..ec5aea7b523e7041 100644
51f0aa
--- a/misc/Versions
51f0aa
+++ b/misc/Versions
51f0aa
@@ -151,6 +151,7 @@ libc {
51f0aa
   }
51f0aa
   GLIBC_PRIVATE {
51f0aa
     __madvise;
51f0aa
+    __mktemp;
51f0aa
     __libc_ifunc_impl_list;
51f0aa
   }
51f0aa
 }
51f0aa
diff --git a/misc/mktemp.c b/misc/mktemp.c
51f0aa
index 05a07cb301f9506e..19824f01a11f9af9 100644
51f0aa
--- a/misc/mktemp.c
51f0aa
+++ b/misc/mktemp.c
51f0aa
@@ -22,7 +22,7 @@
51f0aa
    The last six characters of TEMPLATE must be "XXXXXX";
51f0aa
    they are replaced with a string that makes the filename unique.  */
51f0aa
 char *
51f0aa
-mktemp (template)
51f0aa
+__mktemp (template)
51f0aa
      char *template;
51f0aa
 {
51f0aa
   if (__gen_tempname (template, 0, 0, __GT_NOCREATE) < 0)
51f0aa
@@ -31,5 +31,6 @@ mktemp (template)
51f0aa
 
51f0aa
   return template;
51f0aa
 }
51f0aa
+weak_alias (__mktemp, mktemp)
51f0aa
 
51f0aa
 link_warning (mktemp, "the use of `mktemp' is dangerous, better use `mkstemp'")
51f0aa
diff --git a/nptl/sem_open.c b/nptl/sem_open.c
51f0aa
index d87076e04a55cf71..a0c488b62ffebcc4 100644
51f0aa
--- a/nptl/sem_open.c
51f0aa
+++ b/nptl/sem_open.c
51f0aa
@@ -334,7 +334,7 @@ sem_open (const char *name, int oflag, ...)
51f0aa
 	     since the file must be opened with a specific mode.  The
51f0aa
 	     mode cannot later be set since then we cannot apply the
51f0aa
 	     file create mask.  */
51f0aa
-	  if (mktemp (tmpfname) == NULL)
51f0aa
+	  if (__mktemp (tmpfname) == NULL)
51f0aa
 	    return SEM_FAILED;
51f0aa
 
51f0aa
 	  /* Open the file.  Make sure we do not overwrite anything.  */