mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-27 02:10:55 +08:00
[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:
This commit is contained in:
parent
ba8fd7feb2
commit
eefb691edf
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user