mirror of
https://github.com/isc-projects/bind9.git
synced 2026-07-16 11:22:55 -04:00
C++ reserves the word "template"; use "templet" as the parameter to
isc_file_openunique
This commit is contained in:
parent
37cc3f596b
commit
a890fbefa3
2 changed files with 10 additions and 6 deletions
|
|
@ -91,11 +91,15 @@ isc_file_mktemplate(const char *path, char *buf, size_t buflen);
|
|||
*/
|
||||
|
||||
isc_result_t
|
||||
isc_file_openunique(char *template, FILE **fp);
|
||||
isc_file_openunique(char *templet, FILE **fp);
|
||||
/*
|
||||
* Create and open a file with a unique name based on 'template'.
|
||||
* Create and open a file with a unique name based on 'templet'.
|
||||
*
|
||||
* Notes:
|
||||
* 'template' is a reserved work in C++. If you want to complain
|
||||
* about the spelling of 'templet', first look it up in the
|
||||
* Merriam-Webster English dictionary. (http://www.m-w.com/)
|
||||
*
|
||||
* This function works by using the template to generate file names.
|
||||
* The template must be a writable string, as it is modified in place.
|
||||
* Trailing X characters in the file name (full file name on Unix,
|
||||
|
|
|
|||
|
|
@ -116,18 +116,18 @@ isc_file_mktemplate(const char *path, char *buf, size_t buflen) {
|
|||
}
|
||||
|
||||
isc_result_t
|
||||
isc_file_openunique(char *template, FILE **fp) {
|
||||
isc_file_openunique(char *templet, FILE **fp) {
|
||||
int fd;
|
||||
FILE *f;
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
|
||||
REQUIRE(template != NULL);
|
||||
REQUIRE(templet != NULL);
|
||||
REQUIRE(fp != NULL && *fp == NULL);
|
||||
|
||||
/*
|
||||
* Win32 does not have mkstemp.
|
||||
*/
|
||||
fd = mkstemp(template);
|
||||
fd = mkstemp(templet);
|
||||
|
||||
if (fd == -1)
|
||||
switch (errno) {
|
||||
|
|
@ -158,7 +158,7 @@ isc_file_openunique(char *template, FILE **fp) {
|
|||
else
|
||||
result = ISC_R_UNEXPECTED;
|
||||
|
||||
(void)remove(template);
|
||||
(void)remove(templet);
|
||||
(void)close(fd);
|
||||
|
||||
} else
|
||||
|
|
|
|||
Loading…
Reference in a new issue