diff options
author | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-01-19 16:31:21 +0100 |
---|---|---|
committer | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-01-19 16:31:21 +0100 |
commit | 8bffa163f80aedb4e9c01f1652c1e98fa4be68a8 (patch) | |
tree | 3a654eb9e366f96de7f87db2448355e841cf2f62 /client | |
parent | 6b596534c024b2380e8a20473d4953d348956c37 (diff) | |
download | mariadb-git-8bffa163f80aedb4e9c01f1652c1e98fa4be68a8.tar.gz |
Fix various compiler/OS compatibility errors
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqltest.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index b99541b7907..7d5e35befbb 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -73,7 +73,7 @@ #define QUERY_REAP_FLAG 2 #ifndef HAVE_SETENV -#error implement our portable setenv replacement in mysys +static int setenv(const char *name, const char *value, int overwrite) #endif enum { @@ -9672,3 +9672,18 @@ void dynstr_append_sorted(DYNAMIC_STRING* ds, DYNAMIC_STRING *ds_input) delete_dynamic(&lines); DBUG_VOID_RETURN; } + +#ifndef HAVE_SETENV +static int setenv(const char *name, const char *value, int overwrite) +{ + size_t buflen= strlen(name) + strlen(value) + 2; + char *envvar= malloc(buflen); + if(!envvar) + return ENOMEM; + strcpy(envvar, name); + strcat(envvar, "="); + strcat(envvar, value); + putenv(envvar); + return 0; +} +#endif |