Just because glibc uses K&R, and uses template as an identifier,
doesn't mean we have to.
* lib/mkdtemp.c (mkdtemp): Change spelling of template.
* lib/mkostemp.c (mkostemp): Likewise.
* lib/mkostemps.c (mkostemps): Likewise.
* lib/mkstemp.c (mkstemp): Likewise.
* lib/mkstemps.c (mkstemps): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
2009-11-17 Eric Blake <ebb9@byu.net>
2009-11-17 Eric Blake <ebb9@byu.net>
+ mkstemp: avoid conflict with C++ keyword template
+ * lib/mkdtemp.c (mkdtemp): Change spelling of template.
+ * lib/mkostemp.c (mkostemp): Likewise.
+ * lib/mkostemps.c (mkostemps): Likewise.
+ * lib/mkstemp.c (mkstemp): Likewise.
+ * lib/mkstemps.c (mkstemps): Likewise.
+
xalloc-die-tests: optimize
* tests/test-xalloc-die.sh: Reduce number of processes.
xalloc-die-tests: optimize
* tests/test-xalloc-die.sh: Reduce number of processes.
-/* Generate a unique temporary directory from TEMPLATE.
- The last six characters of TEMPLATE must be "XXXXXX";
+/* Generate a unique temporary directory from XTEMPLATE.
+ The last six characters of XTEMPLATE must be "XXXXXX";
they are replaced with a string that makes the filename unique.
The directory is created, mode 700, and its name is returned.
(This function comes from OpenBSD.) */
char *
they are replaced with a string that makes the filename unique.
The directory is created, mode 700, and its name is returned.
(This function comes from OpenBSD.) */
char *
-mkdtemp (char *template)
+mkdtemp (char *xtemplate)
- if (gen_tempname (template, 0, 0, GT_DIR))
+ if (gen_tempname (xtemplate, 0, 0, GT_DIR))
# define __GT_FILE 0
#endif
# define __GT_FILE 0
#endif
-/* Generate a unique temporary file name from TEMPLATE.
- The last six characters of TEMPLATE must be "XXXXXX";
+/* Generate a unique temporary file name from XTEMPLATE.
+ The last six characters of XTEMPLATE must be "XXXXXX";
they are replaced with a string that makes the file name unique.
Then open the file and return a fd. */
int
they are replaced with a string that makes the file name unique.
Then open the file and return a fd. */
int
-mkostemp (template, flags)
- char *template;
- int flags;
+mkostemp (char *xtemplate, int flags)
- return __gen_tempname (template, 0, flags, __GT_FILE);
+ return __gen_tempname (xtemplate, 0, flags, __GT_FILE);
# define __GT_FILE 0
#endif
# define __GT_FILE 0
#endif
-/* Generate a unique temporary file name from TEMPLATE. The last six
- characters before a suffix of length SUFFIXLEN of TEMPLATE must be
+/* Generate a unique temporary file name from XTEMPLATE. The last six
+ characters before a suffix of length SUFFIXLEN of XTEMPLATE must be
"XXXXXX"; they are replaced with a string that makes the filename
unique. Then open the file and return a fd. */
int
"XXXXXX"; they are replaced with a string that makes the filename
unique. Then open the file and return a fd. */
int
-mkostemps (template, suffixlen, flags)
- char *template;
- int suffixlen;
- int flags;
+mkostemps (char *xtemplate, int suffixlen, int flags)
- return __gen_tempname (template, suffixlen, flags, __GT_FILE);
+ return __gen_tempname (xtemplate, suffixlen, flags, __GT_FILE);
# define __GT_FILE 0
#endif
# define __GT_FILE 0
#endif
-/* Generate a unique temporary file name from TEMPLATE.
- The last six characters of TEMPLATE must be "XXXXXX";
+/* Generate a unique temporary file name from XTEMPLATE.
+ The last six characters of XTEMPLATE must be "XXXXXX";
they are replaced with a string that makes the file name unique.
Then open the file and return a fd. */
int
they are replaced with a string that makes the file name unique.
Then open the file and return a fd. */
int
-mkstemp (template)
- char *template;
+mkstemp (char *xtemplate)
- return __gen_tempname (template, 0, 0, __GT_FILE);
+ return __gen_tempname (xtemplate, 0, 0, __GT_FILE);
# define __GT_FILE 0
#endif
# define __GT_FILE 0
#endif
-/* Generate a unique temporary file name from TEMPLATE. The last six
- characters before a suffix of length SUFFIXLEN of TEMPLATE must be
+/* Generate a unique temporary file name from XTEMPLATE. The last six
+ characters before a suffix of length SUFFIXLEN of XTEMPLATE must be
"XXXXXX"; they are replaced with a string that makes the filename
unique. Then open the file and return a fd. */
int
"XXXXXX"; they are replaced with a string that makes the filename
unique. Then open the file and return a fd. */
int
-mkstemps (template, suffixlen)
- char *template;
- int suffixlen;
+mkstemps (char *xtemplate, int suffixlen)
- return __gen_tempname (template, suffixlen, 0, __GT_FILE);
+ return __gen_tempname (xtemplate, suffixlen, 0, __GT_FILE);