diff options
Diffstat (limited to 'mysys/mf_tempfile.c')
-rw-r--r-- | mysys/mf_tempfile.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/mysys/mf_tempfile.c b/mysys/mf_tempfile.c index 40016210de4..b5933dcc317 100644 --- a/mysys/mf_tempfile.c +++ b/mysys/mf_tempfile.c @@ -109,7 +109,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix, (*free)(res); file=my_create(to, 0, mode | O_EXCL | O_NOFOLLOW, MyFlags); } -#elif defined(HAVE_MKSTEMP) && !defined(__NETWARE__) +#elif defined(HAVE_MKSTEMP) { char prefix_buff[30]; uint pfx_len; @@ -143,9 +143,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix, } #elif defined(HAVE_TEMPNAM) { -#if !defined(__NETWARE__) extern char **environ; -#endif char *res,**old_env,*temp_env[1]; if (dir && !dir[0]) @@ -154,14 +152,14 @@ File create_temp_file(char *to, const char *dir, const char *prefix, to[1]= 0; dir=to; } -#if !defined(__NETWARE__) + old_env= (char**) environ; if (dir) { /* Don't use TMPDIR if dir is given */ environ=(const char**) temp_env; temp_env[0]=0; } -#endif + if ((res=tempnam((char*) dir, (char*) prefix))) { strmake(to,res,FN_REFLEN-1); @@ -176,9 +174,8 @@ File create_temp_file(char *to, const char *dir, const char *prefix, { DBUG_PRINT("error",("Got error: %d from tempnam",errno)); } -#if !defined(__NETWARE__) + environ=(const char**) old_env; -#endif } #else #error No implementation found for create_temp_file |