changeset 8193:acdb54cba552

mkstemp.h is replaced with <stdlib.h>.
author Bruno Haible <bruno@clisp.org>
date Sun, 18 Feb 2007 15:43:07 +0000
parents b9003c1ee8fa
children 2876b7cca374
files lib/mkstemp-safer.c lib/mkstemp.c lib/stdlib--.h m4/mkstemp.m4 modules/mkstemp
diffstat 5 files changed, 16 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lib/mkstemp-safer.c
+++ b/lib/mkstemp-safer.c
@@ -1,6 +1,6 @@
 /* Invoke mkstemp, but avoid some glitches.
 
-   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@
 
 #include "stdlib-safer.h"
 
-#include "mkstemp.h"
+#include <stdlib.h>
 #include "unistd-safer.h"
 
 /* Like mkstemp, but do not return STDIN_FILENO, STDOUT_FILENO, or
--- a/lib/mkstemp.c
+++ b/lib/mkstemp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2001, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2001, 2005, 2006, 2007 Free Software Foundation, Inc.
    This file is derived from the one in the GNU C Library.
 
    This program is free software; you can redistribute it and/or modify
@@ -17,14 +17,17 @@
 
 #if !_LIBC
 # include <config.h>
-# include "mkstemp.h"
+#endif
+
+#include <stdlib.h>
+
+#if !_LIBC
 # include "tempname.h"
 # define __gen_tempname gen_tempname
 # define __GT_FILE GT_FILE
 #endif
 
 #include <stdio.h>
-#include <stdlib.h>
 
 #ifndef __GT_FILE
 # define __GT_FILE 0
--- a/lib/stdlib--.h
+++ b/lib/stdlib--.h
@@ -1,6 +1,6 @@
 /* Like stdlib.h, but redefine some names to avoid glitches.
 
-   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -21,6 +21,5 @@
 #include <stdlib.h>
 #include "stdlib-safer.h"
 
-#include "mkstemp.h"
 #undef mkstemp
 #define mkstemp mkstemp_safer
--- a/m4/mkstemp.m4
+++ b/m4/mkstemp.m4
@@ -1,6 +1,6 @@
-#serial 16
+#serial 17
 
-# Copyright (C) 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -13,6 +13,7 @@
 # On systems like the above, arrange to use the replacement function.
 AC_DEFUN([gl_FUNC_MKSTEMP],
 [
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
   AC_REQUIRE([AC_SYS_LARGEFILE])
 
   AC_CACHE_CHECK([for working mkstemp],
@@ -43,8 +44,7 @@
     ])
 
   if test $gl_cv_func_working_mkstemp != yes; then
-    AC_DEFINE([__MKSTEMP_PREFIX], [[rpl_]],
-      [Define to rpl_ if the mkstemp replacement function should be used.])
+    REPLACE_MKSTEMP=1
     AC_LIBOBJ([mkstemp])
     gl_PREREQ_MKSTEMP
   fi
--- a/modules/mkstemp
+++ b/modules/mkstemp
@@ -2,21 +2,22 @@
 mkstemp() function: create a private temporary file.
 
 Files:
-lib/mkstemp.h
 lib/mkstemp.c
 m4/mkstemp.m4
 
 Depends-on:
 extensions
+stdlib
 tempname
 
 configure.ac:
 gl_FUNC_MKSTEMP
+gl_STDLIB_MODULE_INDICATOR([mkstemp])
 
 Makefile.am:
 
 Include:
-"mkstemp.h"
+<stdlib.h>
 
 License:
 GPL