mirror of
https://github.com/php/php-src.git
synced 2025-08-19 17:04:47 +02:00
- Fixed some AIX/HPUX compile issues.
# Just a modified diff of the same file found in mysql 4.0.12 :)
This commit is contained in:
parent
f140ae993f
commit
b83fc1a802
1 changed files with 17 additions and 5 deletions
|
@ -10,6 +10,12 @@ This file is public domain and comes with NO WARRANTY of any kind */
|
||||||
|
|
||||||
#include "mysys_priv.h"
|
#include "mysys_priv.h"
|
||||||
#include <m_string.h>
|
#include <m_string.h>
|
||||||
|
|
||||||
|
/* HPUX 11.0 doesn't allow us to change the environ pointer */
|
||||||
|
#ifdef HPUX11
|
||||||
|
#undef HAVE_TEMPNAM
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "my_static.h"
|
#include "my_static.h"
|
||||||
#include "mysys_err.h"
|
#include "mysys_err.h"
|
||||||
|
|
||||||
|
@ -19,7 +25,7 @@ This file is public domain and comes with NO WARRANTY of any kind */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_TEMPNAM
|
#ifdef HAVE_TEMPNAM
|
||||||
#if !defined( MSDOS) && !defined(OS2)
|
#if !defined( MSDOS) && !defined(OS2) && !defined(__NETWARE__)
|
||||||
extern char **environ;
|
extern char **environ;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -92,17 +98,23 @@ my_string my_tempnam(const char *dir, const char *pfx,
|
||||||
if (buffer[strlen(buffer)-1] == '\\')
|
if (buffer[strlen(buffer)-1] == '\\')
|
||||||
buffer[strlen(buffer)-1] = '\0';
|
buffer[strlen(buffer)-1] = '\0';
|
||||||
putenv( buffer);
|
putenv( buffer);
|
||||||
#else
|
#elif !defined(__NETWARE__)
|
||||||
old_env=(char**)environ;
|
old_env=(char**)environ;
|
||||||
if (dir)
|
if (dir)
|
||||||
{ /* Don't use TMPDIR if dir is given */
|
{ /* Don't use TMPDIR if dir is given */
|
||||||
((char **)environ)=(char**)temp_env; /* May give warning */
|
/*
|
||||||
|
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;
|
temp_env[0]=0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
res=tempnam((char*) dir,(my_string) pfx); /* Use stand. dir with prefix */
|
res=tempnam((char*) dir,(my_string) pfx); /* Use stand. dir with prefix */
|
||||||
#ifndef OS2
|
#if !defined(OS2) && !defined(__NETWARE__)
|
||||||
((char**)environ)=(char**)old_env; /* May give warning */
|
(*(char***) &environ)=(char**) old_env;
|
||||||
#endif
|
#endif
|
||||||
if (!res)
|
if (!res)
|
||||||
DBUG_PRINT("error",("Got error: %d from tempnam",errno));
|
DBUG_PRINT("error",("Got error: %d from tempnam",errno));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue