summaryrefslogtreecommitdiff
path: root/mysys/my_tempnam.c
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2003-03-07 01:00:58 +0200
committermonty@mashka.mysql.fi <>2003-03-07 01:00:58 +0200
commit13de61cc3a3feebbca41553e62bbfb34acc7ad27 (patch)
tree2c6510164c1daabd81513593ccdf9fcf413109d0 /mysys/my_tempnam.c
parentac5135860dd0320edf4df3827944cfe07264884d (diff)
downloadmariadb-git-13de61cc3a3feebbca41553e62bbfb34acc7ad27.tar.gz
Portability fix for IBM compiler on AIX
Diffstat (limited to 'mysys/my_tempnam.c')
-rw-r--r--mysys/my_tempnam.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/mysys/my_tempnam.c b/mysys/my_tempnam.c
index a652fae3574..d079b9f66a5 100644
--- a/mysys/my_tempnam.c
+++ b/mysys/my_tempnam.c
@@ -115,13 +115,19 @@ my_string my_tempnam(const char *dir, const char *pfx,
old_env=(char**)environ;
if (dir)
{ /* Don't use TMPDIR if dir is given */
- ((char**) environ)=(char**) temp_env;
+ /*
+ The following strange cast is required because the IBM compiler on AIX
+ doesn't allow us to cast the value of environ.
+ The cast of environ is needed as some systems doesn't allow us to
+ update environ with a char ** pointer. (const mismatch)
+ */
+ (*(char***) &environ)=(char**) temp_env;
temp_env[0]=0;
}
#endif
res=tempnam((char*) dir,(my_string) pfx); /* Use stand. dir with prefix */
#if !defined(OS2) && !defined(__NETWARE__)
- ((char**) environ)=(char**) old_env;
+ (*(char***) &environ)=(char**) old_env;
#endif
if (!res)
DBUG_PRINT("error",("Got error: %d from tempnam",errno));