From eefb691edfd07019677be207d8ef819ecfea1515 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Tue, 6 May 2003 16:04:39 -0500 Subject: [svn-r6809] Purpose: Bug Fix Description: The "mkstemp()" function isn't as portable as I hoped it would be (it fails on Crays and other beasts). Solution: Removed and just use a fixed filename instead. Platforms tested: Linux Solaris w/ zlib Irix w/ zlib Misc. update: --- perform/zip_perf.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/perform/zip_perf.c b/perform/zip_perf.c index d5ea5cb..0769676 100644 --- a/perform/zip_perf.c +++ b/perform/zip_perf.c @@ -317,14 +317,14 @@ uncompress_buffer(Bytef *dest, uLongf *destLen, const Bytef *source, * Function: get_unique_name * Purpose: Create a new file who's name doesn't conflict with * pre-existing files. - * Returns: + * Returns: Nothing * Programmer: Bill Wendling, 06. June 2002 * Modifications: */ static void get_unique_name(void) { - const char *prefix = "/tmp", *templte = "/zip_perf_XXXXXX"; + const char *prefix = "/tmp", *template = "/zip_perf.data"; const char *env = getenv("HDF5_PREFIX"); if (env) @@ -333,17 +333,13 @@ get_unique_name(void) if (option_prefix) prefix = option_prefix; - filename = calloc(1, strlen(prefix) + strlen(templte) + 1); + filename = calloc(1, strlen(prefix) + strlen(template) + 1); if (!filename) error("out of memory"); strcpy(filename, prefix); - strcat(filename, templte); - output = mkstemp(filename); - - if (output == -1) - error(strerror(errno)); + strcat(filename, template); } /* -- cgit v0.12