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