From a890fbefa3a143ff0513854c895e0f04c8d72bd5 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Wed, 26 Apr 2000 00:45:24 +0000 Subject: [PATCH] C++ reserves the word "template"; use "templet" as the parameter to isc_file_openunique --- lib/isc/include/isc/file.h | 8 ++++++-- lib/isc/unix/file.c | 8 ++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/isc/include/isc/file.h b/lib/isc/include/isc/file.h index b99cf24ee3..556c8f957d 100644 --- a/lib/isc/include/isc/file.h +++ b/lib/isc/include/isc/file.h @@ -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, diff --git a/lib/isc/unix/file.c b/lib/isc/unix/file.c index a6ba107a6e..1001d7d7f2 100644 --- a/lib/isc/unix/file.c +++ b/lib/isc/unix/file.c @@ -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