OSDN Git Service

mkostemp: fix implementation
[uclinux-h8/uClibc.git] / libc / stdlib / mkstemp.c
index de5d557..a3a1595 100644 (file)
 
    You should have received a copy of the GNU Library General Public
    License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   see <http://www.gnu.org/licenses/>.  */
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <sys/stat.h>
+#include "../misc/internals/tempname.h"
 
 /* Generate a unique temporary file name from TEMPLATE.
    The last six characters of TEMPLATE must be "XXXXXX";
@@ -25,5 +26,5 @@
    Then open the file and return a fd. */
 int mkstemp (char *template)
 {
-    return __gen_tempname (template, __GT_FILE);
+    return __gen_tempname (template, __GT_FILE, 0, S_IRUSR | S_IWUSR);
 }