mariadb/mysys/mf_tempfile.c

199 lines
5.3 KiB
C
Raw Normal View History

/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */
#include "mysys_priv.h"
#include <m_string.h>
#include "my_static.h"
#include "mysys_err.h"
#include <errno.h>
#ifdef HAVE_PATHS_H
#include <paths.h>
#endif
#ifdef HAVE_TEMPNAM
Fixes for OS2. Fix bug in isamlog Add argument types to function declarations. Docs/manual.texi: Updated credits client/mysql.cc: Fixes for OS2 client/mysqladmin.c: Fixes for OS2 client/mysqldump.c: Fixes for OS2 client/mysqlimport.c: Fixes for OS2 client/mysqltest.c: Fixes for OS2 dbug/dbug.c: Fixes for OS2. Use new C calling convention. dbug/factorial.c: Fixes for OS2. Use new C calling convention. include/errmsg.h: Fix for OS2 include/global.h: Fixes for OS2. include/my_pthread.h: Fixes for OS2. include/my_sys.h: Fixes for OS2. include/mysql_com.h: Move defines to global.h include/thr_alarm.h: Fixes for OS2. isam/isamchk.c: Fixes for OS2. Add arguments to function declarations. isam/isamlog.c: Fixes for OS2. Fix bug in logfile handling. isam/test1.c: Add arguments to function decl isam/test2.c: Add arguments to function declarations. isam/test_all.res: Update result libmysql/get_password.c: Fixes for OS2. libmysql/libmysql.c: Fixes for OS2. libmysql/net.c: Fixes for OS2. libmysql/violite.c: Add arguments to function declarations. merge/_locking.c: Add argument types to function declarations. merge/close.c: Add argument types to function declarations. merge/create.c: Add argument types to function declarations. merge/extra.c: Add argument types to function declarations. merge/open.c: Add argument types to function declarations. merge/panic.c: Add argument types to function declarations. merge/rsame.c: Add argument types to function declarations. merge/update.c: Add argument types to function declarations. myisam/ft_eval.c: Portability fix myisam/ft_search.c: Portability fix myisam/ft_test1.c: Portability fix myisam/ftdefs.h: Portability fix myisam/mi_check.c: Portability fix myisam/mi_test1.c: Portability fix myisam/mi_test2.c: Portability fix myisam/mi_test_all.sh: Update to test for MACH variable myisam/myisamlog.c: Cleanup myisam/myisampack.c: Don't use variable 'new' myisam/sort.c: Portability fix myisammrg/myrg_delete.c: Add argument types to function declarations. myisammrg/myrg_locking.c: Add argument types to function declarations. myisammrg/myrg_open.c: Add argument types to function declarations. myisammrg/myrg_panic.c: Add argument types to function declarations. mysql-test/t/backup.test: Fix for OS2 mysql-test/t/show_check.test: Fix for OS2 mysys/charset.c: Dont use variable 'new' mysys/default.c: Fixes for OS2. mysys/getopt.c: Fixes for OS2. mysys/getopt1.c: Fixes for OS2. mysys/list.c: Don't use variable 'new' mysys/mf_dirname.c: Fixes for OS2. mysys/mf_format.c: Fixes for OS2. mysys/mf_path.c: Fixes for OS2. mysys/mf_qsort.c: Portability fix mysys/mf_tempfile.c: Fixes for OS2. mysys/my_clock.c: Fixes for OS2. mysys/my_copy.c: Fixes for OS2. mysys/my_create.c: Fixes for OS2. mysys/my_getwd.c: Fixes for OS2. mysys/my_init.c: Fixes for OS2. mysys/my_lib.c: Fixes for OS2. mysys/my_lock.c: Fixes for OS2. mysys/my_malloc.c: Portability fix mysys/my_mkdir.c: Fixes for OS2. mysys/my_open.c: Fixes for OS2. mysys/my_pthread.c: Fixes for OS2. mysys/my_realloc.c: Fixes for OS2. mysys/my_redel.c: Fixes for OS2. mysys/my_static.c: Fixes for OS2. mysys/my_tempnam.c: Fixes for OS2. mysys/my_thr_init.c: Fixes for OS2. mysys/my_write.c: Fixes for OS2. mysys/test_charset.c: Fixes for OS2. mysys/thr_alarm.c: Fixes for OS2. mysys/tree.c: Fixes for OS2. sql/field.cc: Fixes for OS2. sql/field.h: Fixes for OS2. sql/gen_lex_hash.cc: Fixes for OS2. sql/hostname.cc: Fixes for OS2. sql/item_func.cc: Fixes for OS2. sql/item_strfunc.cc: Fixes for OS2. sql/log_event.cc: Fixes for OS2. sql/md5.c: Fixes for OS2. sql/mini_client.cc: Fixes for OS2. sql/mysql_priv.h: Fixes for OS2. sql/mysqld.cc: Fixes for OS2. sql/net_serv.cc: Fixes for OS2. sql/slave.cc: Fixes for OS2. sql/sql_base.cc: Fixes for OS2. sql/sql_db.cc: Portability fix sql/sql_insert.cc: Fixes for OS2. sql/sql_load.cc: Fixes for OS2. sql/sql_parse.cc: Fixes for OS2. sql/sql_table.cc: Fixes for OS2. sql/sql_udf.cc: Fixes for OS2. sql/violite.c: Fixes for OS2. strings/ctype-big5.c: Fixes for OS2. strings/ctype-gbk.c: Fixes for OS2. strings/ctype-sjis.c: Fixes for OS2. strings/ctype-tis620.c: Fixes for OS2. strings/ctype.c: Fixes for OS2. strings/strnlen.c: Fixes for OS2.
2001-08-22 00:45:07 +02:00
#if !defined( MSDOS) && !defined(OS2)
extern char **environ;
#endif
#endif
/*
Create a temporary file in a given directory
This function should be used instead of my_tempnam() !
*/
File create_temp_file(char *to, const char *dir, const char *prefix,
int mode __attribute__((unused)),
myf MyFlags __attribute__((unused)))
{
File file= -1;
DBUG_ENTER("create_temp_file");
#if defined(_MSC_VER)
{
Fix of LEFT JOIN optimizer bug, problem with key cache on Windows and a lot of portability issues. Docs/manual.texi: Changed FOREIGN KEY to FOREIGN KEY constraint client/mysqladmin.c: Don't flush MASTER or SLAVE on refresh configure.in: Fix for hpux 11.0 extra/perror.c: New error message include/my_pthread.h: Portability fix for windows myisam/mi_locking.c: Ensure that locking doesn't interfere with pread/pwrite on windows myisam/sort.c: checked with purecover mysys/mf_tempfile.c: Fix for windows mysys/my_lock.c: Ensure that locking doesn't interfere with pread/pwrite on windows mysys/my_winthread.c: Portability fix sql-bench/Results/ATIS-mysql-NT_4.0: New benchmark runs sql-bench/Results/RUN-mysql-NT_4.0: New benchmark runs sql-bench/Results/alter-table-mysql-NT_4.0: New benchmark runs sql-bench/Results/big-tables-mysql-NT_4.0: New benchmark runs sql-bench/Results/connect-mysql-NT_4.0: New benchmark runs sql-bench/Results/create-mysql-NT_4.0: New benchmark runs sql-bench/Results/insert-mysql-NT_4.0: New benchmark runs sql-bench/Results/select-mysql-NT_4.0: New benchmark runs sql-bench/Results/wisconsin-mysql-NT_4.0: New benchmark runs sql-bench/crash-me.sh: Fixed things for PostgreSQL sql-bench/limits/mysql-3.23.cfg: Update for new crash-me sql-bench/limits/mysql.cfg: Update for new crash-me sql-bench/print-limit-table: Fixed position for alter table rename sql-bench/test-insert.sh: Fix for PostgreSQL sql/field.cc: Fix for default values in CREATE ... SELECT sql/field.h: Fix for default values in CREATE ... SELECT sql/log.cc: Fixed typo sql/log_event.cc: Portability fix sql/mysqlbinlog.cc: Portability fix sql/mysqld.cc: Don't turn of concurrent insert with --skip-new or --safe sql/sql_base.cc: Portability fix sql/sql_class.cc: Portability fix sql/sql_class.h: Portability fix sql/sql_parse.cc: Fix for --log-slow-queries sql/sql_repl.cc: Portability fixes sql/sql_select.cc: Fixed optimizer bug for LEFT JOIN sql/sql_select.h: Fixed optimizer bug for LEFT JOIN sql/sql_table.cc: Fix for default values in CREATE ... SELECT sql/sql_yacc.yy: Added optional AS to: CREATE TABLE foo [ AS ] SELECT ...
2000-10-14 02:16:35 +02:00
char temp[FN_REFLEN],*end,*res,**old_env,*temp_env[1];
old_env=environ;
if (dir)
{
end=strend(dir)-1;
if (!dir[0])
{ /* Change empty string to current dir */
to[0]= FN_CURLIB;
to[1]= 0;
dir=to;
}
else if (*end == FN_DEVCHAR)
{ /* Get current dir for drive */
_fullpath(temp,dir,FN_REFLEN);
dir=to;
}
else if (*end == FN_LIBCHAR && dir < end && end[-1] != FN_DEVCHAR)
{
strmake(to,dir,(uint) (end-dir)); /* Copy and remove last '\' */
dir=to;
}
environ=temp_env; /* Force use of dir (dir not checked) */
temp_env[0]=0;
}
if ((res=tempnam((char*) dir,(char *) prefix)))
{
strmake(to,res,FN_REFLEN-1);
(*free)(res);
file=my_create(to,0, mode, MyFlags);
}
environ=old_env;
}
#elif defined(_ZTC__)
if (!dir)
dir=getenv("TMPDIR");
if ((res=tempnam((char*) dir,(char *) prefix)))
{
strmake(to,res,FN_REFLEN-1);
(*free)(res);
file=my_create(to, 0, mode, MyFlags);
}
#elif defined(HAVE_MKSTEMP)
{
char prefix_buff[30];
uint pfx_len;
Lots of new benchmark runs Remember filename for temporary files created with mkstemp Fixed wrongly allocated BDB share structure Cleanups for SunPRO BitKeeper/deleted/.del-ATIS-mysql-SunOS_5.6_sun4m~62028e0375b3b8b: ***MISSING WEAVE*** BitKeeper/deleted/.del-RUN-mysql-SunOS_5.6_sun4m~eafc8188345e262b: ***MISSING WEAVE*** BitKeeper/deleted/.del-alter-table-mysql-SunOS_5.6_sun4m~8a1bd6589a189890: ***MISSING WEAVE*** BitKeeper/deleted/.del-big-tables-mysql-SunOS_5.6_sun4m~f351a7f3e1e2257e: ***MISSING WEAVE*** BitKeeper/deleted/.del-connect-mysql-SunOS_5.6_sun4m~a10e3ddfa26a3e7f: ***MISSING WEAVE*** BitKeeper/deleted/.del-create-mysql-SunOS_5.6_sun4m~9233114ae6f8c5f: ***MISSING WEAVE*** BitKeeper/deleted/.del-insert-mysql-SunOS_5.6_sun4m~3402d060ae20e19: ***MISSING WEAVE*** BitKeeper/deleted/.del-select-mysql-SunOS_5.6_sun4m~4da215905bce988d: ***MISSING WEAVE*** BitKeeper/deleted/.del-wisconsin-mysql-SunOS_5.6_sun4m~ec61b14072715dc8: ***MISSING WEAVE*** BitKeeper/deleted/.del-ATIS-mysql-Linux_2.2.12_20smp_i686~28211fb9f0e6ab0e: ***MISSING WEAVE*** BitKeeper/deleted/.del-RUN-mysql-Linux_2.2.12_20smp_i686~da28ced3e0aac09c: ***MISSING WEAVE*** BitKeeper/deleted/.del-alter-table-mysql-Linux_2.2.12_20smp_i686~67ae4e91b5f4eabd: ***MISSING WEAVE*** BitKeeper/deleted/.del-big-tables-mysql-Linux_2.2.12_20smp_i686~a2dcb74a3c73ac18: ***MISSING WEAVE*** BitKeeper/deleted/.del-connect-mysql-Linux_2.2.12_20smp_i686~beedcd769a903c19: ***MISSING WEAVE*** BitKeeper/deleted/.del-create-mysql-Linux_2.2.12_20smp_i686~fe23ee50aea195f4: ***MISSING WEAVE*** BitKeeper/deleted/.del-insert-mysql-Linux_2.2.12_20smp_i686~f120b0ead3836c81: ***MISSING WEAVE*** BitKeeper/deleted/.del-select-mysql-Linux_2.2.12_20smp_i686~3b64aff0dfddfff4: ***MISSING WEAVE*** BitKeeper/deleted/.del-wisconsin-mysql-Linux_2.2.12_20smp_i686~d49db545341a732f: ***MISSING WEAVE*** BitKeeper/deleted/.del-ATIS-mysql-Linux_2.2.13_SMP_alpha~136bdd9fd1a2cd14: ***MISSING WEAVE*** BitKeeper/deleted/.del-ATIS-mysql_fast-Linux_2.2.13_SMP_alpha~defb62af5958fcac: ***MISSING WEAVE*** BitKeeper/deleted/.del-RUN-mysql-Linux_2.2.13_SMP_alpha~f6fa9f46d4a6152: ***MISSING WEAVE*** BitKeeper/deleted/.del-RUN-mysql_fast-Linux_2.2.13_SMP_alpha~16694c5927b7600c: ***MISSING WEAVE*** BitKeeper/deleted/.del-alter-table-mysql-Linux_2.2.13_SMP_alpha~c85eb85ba45dd748: ***MISSING WEAVE*** BitKeeper/deleted/.del-alter-table-mysql_fast-Linux_2.2.13_SMP_alpha~b062db76cf6df5d2: ***MISSING WEAVE*** BitKeeper/deleted/.del-big-tables-mysql-Linux_2.2.13_SMP_alpha~b5f4f4c35225f0f: ***MISSING WEAVE*** BitKeeper/deleted/.del-big-tables-mysql_fast-Linux_2.2.13_SMP_alpha~a9eedd951eab7e8b: ***MISSING WEAVE*** BitKeeper/deleted/.del-connect-mysql-Linux_2.2.13_SMP_alpha~74ec2bf5f55b81f: ***MISSING WEAVE*** BitKeeper/deleted/.del-connect-mysql_fast-Linux_2.2.13_SMP_alpha~f6d7665c418d62c6: ***MISSING WEAVE*** BitKeeper/deleted/.del-create-mysql-Linux_2.2.13_SMP_alpha~771b40d3280fe8ad: ***MISSING WEAVE*** BitKeeper/deleted/.del-create-mysql_fast-Linux_2.2.13_SMP_alpha~c46d6c283c0e34ae: ***MISSING WEAVE*** BitKeeper/deleted/.del-insert-mysql-Linux_2.2.13_SMP_alpha~17f262f12d2244bc: ***MISSING WEAVE*** BitKeeper/deleted/.del-insert-mysql_fast-Linux_2.2.13_SMP_alpha~3245ba5633a18e8: ***MISSING WEAVE*** BitKeeper/deleted/.del-select-mysql-Linux_2.2.13_SMP_alpha~9fd9c6e036f988d7: ***MISSING WEAVE*** BitKeeper/deleted/.del-select-mysql_fast-Linux_2.2.13_SMP_alpha~744633c6e13a897f: ***MISSING WEAVE*** BitKeeper/deleted/.del-wisconsin-mysql-Linux_2.2.13_SMP_alpha~ad7babd436f26841: ***MISSING WEAVE*** BitKeeper/deleted/.del-wisconsin-mysql_fast-Linux_2.2.13_SMP_alpha~6ad065fe4c6b4fa9: ***MISSING WEAVE*** BUILD/compile-pentium: Added command line arguments Docs/manual.texi: Update for 3.23.30 configure.in: Removed duplicated symbol include/my_sys.h: cleanup of my_open/my_create/my_tempfile mysys/mf_tempfile.c: Remember filename for temporary files created with mkstemp mysys/my_create.c: cleanup of my_open/my_create/my_tempfile mysys/my_open.c: cleanup of my_open/my_create/my_tempfile scripts/mysqld_multi.sh: Use paths from configure scripts/safe_mysqld.sh: Cleanup sql-bench/Results/ATIS-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/RUN-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/alter-table-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/big-tables-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/connect-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/create-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/insert-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/select-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/wisconsin-mysql-SunOS_5.7_sun4m: New benchmark results sql/ha_berkeley.cc: Fixed wrongly allocated share structure sql/item_cmpfunc.cc: Cleanup sql/item_cmpfunc.h: Cleanup sql/log_event.h: Cleanup sql/mysqld.cc: Changed default number of BDB locks to 10000 sql/sql_class.h: cleanup sql/sql_show.cc: cleanup support-files/mysql.spec.sh: Added mysqld_multi sql-bench/Results-linux/ATIS-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/ATIS-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/RUN-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/RUN-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/alter-table-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/alter-table-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/big-tables-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/big-tables-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/connect-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/connect-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/create-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/create-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/insert-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/insert-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/select-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/select-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/wisconsin-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/wisconsin-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE***
2000-12-18 15:09:19 +01:00
File org_file;
pfx_len=(strmov(strnmov(prefix_buff,
prefix ? prefix : "tmp.",
sizeof(prefix_buff)-7),"XXXXXX") - prefix_buff);
if (!dir && ! (dir =getenv("TMPDIR")))
dir=P_tmpdir;
if (strlen(dir)+ pfx_len > FN_REFLEN-2)
{
errno=my_errno= ENAMETOOLONG;
return 1;
}
strmov(to,dir);
strmov(convert_dirname(to),prefix_buff);
Lots of new benchmark runs Remember filename for temporary files created with mkstemp Fixed wrongly allocated BDB share structure Cleanups for SunPRO BitKeeper/deleted/.del-ATIS-mysql-SunOS_5.6_sun4m~62028e0375b3b8b: ***MISSING WEAVE*** BitKeeper/deleted/.del-RUN-mysql-SunOS_5.6_sun4m~eafc8188345e262b: ***MISSING WEAVE*** BitKeeper/deleted/.del-alter-table-mysql-SunOS_5.6_sun4m~8a1bd6589a189890: ***MISSING WEAVE*** BitKeeper/deleted/.del-big-tables-mysql-SunOS_5.6_sun4m~f351a7f3e1e2257e: ***MISSING WEAVE*** BitKeeper/deleted/.del-connect-mysql-SunOS_5.6_sun4m~a10e3ddfa26a3e7f: ***MISSING WEAVE*** BitKeeper/deleted/.del-create-mysql-SunOS_5.6_sun4m~9233114ae6f8c5f: ***MISSING WEAVE*** BitKeeper/deleted/.del-insert-mysql-SunOS_5.6_sun4m~3402d060ae20e19: ***MISSING WEAVE*** BitKeeper/deleted/.del-select-mysql-SunOS_5.6_sun4m~4da215905bce988d: ***MISSING WEAVE*** BitKeeper/deleted/.del-wisconsin-mysql-SunOS_5.6_sun4m~ec61b14072715dc8: ***MISSING WEAVE*** BitKeeper/deleted/.del-ATIS-mysql-Linux_2.2.12_20smp_i686~28211fb9f0e6ab0e: ***MISSING WEAVE*** BitKeeper/deleted/.del-RUN-mysql-Linux_2.2.12_20smp_i686~da28ced3e0aac09c: ***MISSING WEAVE*** BitKeeper/deleted/.del-alter-table-mysql-Linux_2.2.12_20smp_i686~67ae4e91b5f4eabd: ***MISSING WEAVE*** BitKeeper/deleted/.del-big-tables-mysql-Linux_2.2.12_20smp_i686~a2dcb74a3c73ac18: ***MISSING WEAVE*** BitKeeper/deleted/.del-connect-mysql-Linux_2.2.12_20smp_i686~beedcd769a903c19: ***MISSING WEAVE*** BitKeeper/deleted/.del-create-mysql-Linux_2.2.12_20smp_i686~fe23ee50aea195f4: ***MISSING WEAVE*** BitKeeper/deleted/.del-insert-mysql-Linux_2.2.12_20smp_i686~f120b0ead3836c81: ***MISSING WEAVE*** BitKeeper/deleted/.del-select-mysql-Linux_2.2.12_20smp_i686~3b64aff0dfddfff4: ***MISSING WEAVE*** BitKeeper/deleted/.del-wisconsin-mysql-Linux_2.2.12_20smp_i686~d49db545341a732f: ***MISSING WEAVE*** BitKeeper/deleted/.del-ATIS-mysql-Linux_2.2.13_SMP_alpha~136bdd9fd1a2cd14: ***MISSING WEAVE*** BitKeeper/deleted/.del-ATIS-mysql_fast-Linux_2.2.13_SMP_alpha~defb62af5958fcac: ***MISSING WEAVE*** BitKeeper/deleted/.del-RUN-mysql-Linux_2.2.13_SMP_alpha~f6fa9f46d4a6152: ***MISSING WEAVE*** BitKeeper/deleted/.del-RUN-mysql_fast-Linux_2.2.13_SMP_alpha~16694c5927b7600c: ***MISSING WEAVE*** BitKeeper/deleted/.del-alter-table-mysql-Linux_2.2.13_SMP_alpha~c85eb85ba45dd748: ***MISSING WEAVE*** BitKeeper/deleted/.del-alter-table-mysql_fast-Linux_2.2.13_SMP_alpha~b062db76cf6df5d2: ***MISSING WEAVE*** BitKeeper/deleted/.del-big-tables-mysql-Linux_2.2.13_SMP_alpha~b5f4f4c35225f0f: ***MISSING WEAVE*** BitKeeper/deleted/.del-big-tables-mysql_fast-Linux_2.2.13_SMP_alpha~a9eedd951eab7e8b: ***MISSING WEAVE*** BitKeeper/deleted/.del-connect-mysql-Linux_2.2.13_SMP_alpha~74ec2bf5f55b81f: ***MISSING WEAVE*** BitKeeper/deleted/.del-connect-mysql_fast-Linux_2.2.13_SMP_alpha~f6d7665c418d62c6: ***MISSING WEAVE*** BitKeeper/deleted/.del-create-mysql-Linux_2.2.13_SMP_alpha~771b40d3280fe8ad: ***MISSING WEAVE*** BitKeeper/deleted/.del-create-mysql_fast-Linux_2.2.13_SMP_alpha~c46d6c283c0e34ae: ***MISSING WEAVE*** BitKeeper/deleted/.del-insert-mysql-Linux_2.2.13_SMP_alpha~17f262f12d2244bc: ***MISSING WEAVE*** BitKeeper/deleted/.del-insert-mysql_fast-Linux_2.2.13_SMP_alpha~3245ba5633a18e8: ***MISSING WEAVE*** BitKeeper/deleted/.del-select-mysql-Linux_2.2.13_SMP_alpha~9fd9c6e036f988d7: ***MISSING WEAVE*** BitKeeper/deleted/.del-select-mysql_fast-Linux_2.2.13_SMP_alpha~744633c6e13a897f: ***MISSING WEAVE*** BitKeeper/deleted/.del-wisconsin-mysql-Linux_2.2.13_SMP_alpha~ad7babd436f26841: ***MISSING WEAVE*** BitKeeper/deleted/.del-wisconsin-mysql_fast-Linux_2.2.13_SMP_alpha~6ad065fe4c6b4fa9: ***MISSING WEAVE*** BUILD/compile-pentium: Added command line arguments Docs/manual.texi: Update for 3.23.30 configure.in: Removed duplicated symbol include/my_sys.h: cleanup of my_open/my_create/my_tempfile mysys/mf_tempfile.c: Remember filename for temporary files created with mkstemp mysys/my_create.c: cleanup of my_open/my_create/my_tempfile mysys/my_open.c: cleanup of my_open/my_create/my_tempfile scripts/mysqld_multi.sh: Use paths from configure scripts/safe_mysqld.sh: Cleanup sql-bench/Results/ATIS-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/RUN-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/alter-table-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/big-tables-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/connect-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/create-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/insert-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/select-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/wisconsin-mysql-SunOS_5.7_sun4m: New benchmark results sql/ha_berkeley.cc: Fixed wrongly allocated share structure sql/item_cmpfunc.cc: Cleanup sql/item_cmpfunc.h: Cleanup sql/log_event.h: Cleanup sql/mysqld.cc: Changed default number of BDB locks to 10000 sql/sql_class.h: cleanup sql/sql_show.cc: cleanup support-files/mysql.spec.sh: Added mysqld_multi sql-bench/Results-linux/ATIS-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/ATIS-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/RUN-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/RUN-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/alter-table-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/alter-table-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/big-tables-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/big-tables-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/connect-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/connect-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/create-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/create-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/insert-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/insert-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/select-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/select-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/wisconsin-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/wisconsin-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE***
2000-12-18 15:09:19 +01:00
org_file=mkstemp(to);
file=my_register_filename(org_file, to, FILE_BY_MKSTEMP,
EE_CANTCREATEFILE, MyFlags);
/* If we didn't manage to register the name, remove the temp file */
if (org_file >= 0 && file < 0)
{
int tmp=my_errno;
(void) my_delete(to, MYF(MY_WME | ME_NOINPUT));
my_errno=tmp;
}
}
#elif defined(HAVE_TEMPNAM)
{
char *res,**old_env,*temp_env[1];
if (dir && !dir[0])
{ /* Change empty string to current dir */
to[0]= FN_CURLIB;
to[1]= 0;
dir=to;
}
Fixes for OS2. Fix bug in isamlog Add argument types to function declarations. Docs/manual.texi: Updated credits client/mysql.cc: Fixes for OS2 client/mysqladmin.c: Fixes for OS2 client/mysqldump.c: Fixes for OS2 client/mysqlimport.c: Fixes for OS2 client/mysqltest.c: Fixes for OS2 dbug/dbug.c: Fixes for OS2. Use new C calling convention. dbug/factorial.c: Fixes for OS2. Use new C calling convention. include/errmsg.h: Fix for OS2 include/global.h: Fixes for OS2. include/my_pthread.h: Fixes for OS2. include/my_sys.h: Fixes for OS2. include/mysql_com.h: Move defines to global.h include/thr_alarm.h: Fixes for OS2. isam/isamchk.c: Fixes for OS2. Add arguments to function declarations. isam/isamlog.c: Fixes for OS2. Fix bug in logfile handling. isam/test1.c: Add arguments to function decl isam/test2.c: Add arguments to function declarations. isam/test_all.res: Update result libmysql/get_password.c: Fixes for OS2. libmysql/libmysql.c: Fixes for OS2. libmysql/net.c: Fixes for OS2. libmysql/violite.c: Add arguments to function declarations. merge/_locking.c: Add argument types to function declarations. merge/close.c: Add argument types to function declarations. merge/create.c: Add argument types to function declarations. merge/extra.c: Add argument types to function declarations. merge/open.c: Add argument types to function declarations. merge/panic.c: Add argument types to function declarations. merge/rsame.c: Add argument types to function declarations. merge/update.c: Add argument types to function declarations. myisam/ft_eval.c: Portability fix myisam/ft_search.c: Portability fix myisam/ft_test1.c: Portability fix myisam/ftdefs.h: Portability fix myisam/mi_check.c: Portability fix myisam/mi_test1.c: Portability fix myisam/mi_test2.c: Portability fix myisam/mi_test_all.sh: Update to test for MACH variable myisam/myisamlog.c: Cleanup myisam/myisampack.c: Don't use variable 'new' myisam/sort.c: Portability fix myisammrg/myrg_delete.c: Add argument types to function declarations. myisammrg/myrg_locking.c: Add argument types to function declarations. myisammrg/myrg_open.c: Add argument types to function declarations. myisammrg/myrg_panic.c: Add argument types to function declarations. mysql-test/t/backup.test: Fix for OS2 mysql-test/t/show_check.test: Fix for OS2 mysys/charset.c: Dont use variable 'new' mysys/default.c: Fixes for OS2. mysys/getopt.c: Fixes for OS2. mysys/getopt1.c: Fixes for OS2. mysys/list.c: Don't use variable 'new' mysys/mf_dirname.c: Fixes for OS2. mysys/mf_format.c: Fixes for OS2. mysys/mf_path.c: Fixes for OS2. mysys/mf_qsort.c: Portability fix mysys/mf_tempfile.c: Fixes for OS2. mysys/my_clock.c: Fixes for OS2. mysys/my_copy.c: Fixes for OS2. mysys/my_create.c: Fixes for OS2. mysys/my_getwd.c: Fixes for OS2. mysys/my_init.c: Fixes for OS2. mysys/my_lib.c: Fixes for OS2. mysys/my_lock.c: Fixes for OS2. mysys/my_malloc.c: Portability fix mysys/my_mkdir.c: Fixes for OS2. mysys/my_open.c: Fixes for OS2. mysys/my_pthread.c: Fixes for OS2. mysys/my_realloc.c: Fixes for OS2. mysys/my_redel.c: Fixes for OS2. mysys/my_static.c: Fixes for OS2. mysys/my_tempnam.c: Fixes for OS2. mysys/my_thr_init.c: Fixes for OS2. mysys/my_write.c: Fixes for OS2. mysys/test_charset.c: Fixes for OS2. mysys/thr_alarm.c: Fixes for OS2. mysys/tree.c: Fixes for OS2. sql/field.cc: Fixes for OS2. sql/field.h: Fixes for OS2. sql/gen_lex_hash.cc: Fixes for OS2. sql/hostname.cc: Fixes for OS2. sql/item_func.cc: Fixes for OS2. sql/item_strfunc.cc: Fixes for OS2. sql/log_event.cc: Fixes for OS2. sql/md5.c: Fixes for OS2. sql/mini_client.cc: Fixes for OS2. sql/mysql_priv.h: Fixes for OS2. sql/mysqld.cc: Fixes for OS2. sql/net_serv.cc: Fixes for OS2. sql/slave.cc: Fixes for OS2. sql/sql_base.cc: Fixes for OS2. sql/sql_db.cc: Portability fix sql/sql_insert.cc: Fixes for OS2. sql/sql_load.cc: Fixes for OS2. sql/sql_parse.cc: Fixes for OS2. sql/sql_table.cc: Fixes for OS2. sql/sql_udf.cc: Fixes for OS2. sql/violite.c: Fixes for OS2. strings/ctype-big5.c: Fixes for OS2. strings/ctype-gbk.c: Fixes for OS2. strings/ctype-sjis.c: Fixes for OS2. strings/ctype-tis620.c: Fixes for OS2. strings/ctype.c: Fixes for OS2. strings/strnlen.c: Fixes for OS2.
2001-08-22 00:45:07 +02:00
#ifdef OS2
// changing environ variable doesn't work with VACPP
char buffer[256];
sprintf( buffer, "TMP=%s", dir);
Update for OS2 (patch from Yuri Dario). Use LONG_TIMEOUT (one year) instead of ~0 for long timeouts Fixed error messages. Fixed problem with const propagation when comparing columns of different types BitKeeper/deleted/.del-.cvsignore~a91d63182f0b2366: Delete: sql/share/norwegian/.cvsignore BitKeeper/deleted/.del-.cvsignore~469064b5190d703d: Delete: sql/share/norwegian-ny/.cvsignore Docs/manual.texi: Changelog client/client_priv.h: Update for OS2 client/mysqldump.c: Update for OS2 include/mysqld_error.h: Updated error texts isam/create.c: Removed warning myisam/myisamchk.c: Fix for OS2 myisam/myisampack.c: Fix for OS2 mysys/mf_cache.c: Fix for OS2 mysys/mf_tempfile.c: Fix for OS2 mysys/my_os2file64.c: Fix for OS2 mysys/my_tempnam.c: Fix for OS2 os2/ChangeLog.os2: Fix for OS2 os2/MySQL-Client.icc: Fix for OS2 os2/MySQL-Opt.icc: Fix for OS2 os2/MySQL-Source.icc: Fix for OS2 os2/MySQL-Sql.icc: Fix for OS2 os2/MySQL-Util.icc: Fix for OS2 sql/mysqld.cc: Use LONG_TIMEOUT (one year) instead of ~0 for long timeouts. This avoids some problems when users spefices wrong arguments to mysqld. sql/nt_servc.cc: C sql/share/czech/errmsg.txt: Updated error texts sql/share/danish/errmsg.txt: Updated error texts sql/share/dutch/errmsg.txt: Updated error texts sql/share/english/errmsg.txt: Updated error texts sql/share/estonian/errmsg.txt: Updated error texts sql/share/french/errmsg.txt: Updated error texts sql/share/german/errmsg.txt: Updated error texts sql/share/greek/errmsg.txt: Updated error texts sql/share/hungarian/errmsg.txt: Updated error texts sql/share/italian/errmsg.txt: Updated error texts sql/share/japanese/errmsg.txt: Updated error texts sql/share/korean/errmsg.txt: Updated error texts sql/share/norwegian-ny/errmsg.txt: Updated error texts sql/share/norwegian/errmsg.txt: Updated error texts sql/share/polish/errmsg.txt: Updated error texts sql/share/portuguese/errmsg.txt: Updated error texts sql/share/romanian/errmsg.txt: Updated error texts sql/share/russian/errmsg.txt: Updated error texts sql/share/slovak/errmsg.txt: Updated error texts sql/share/spanish/errmsg.txt: Updated error texts sql/share/swedish/errmsg.txt: Updated error texts sql/share/ukrainian/errmsg.txt: Updated error texts sql/sql_select.cc: Fixed problem with const propagation when comparing columns of different types. Fixed bug when HEAP table is converted to MyISAM tables in GROUP BY on long strings.
2001-10-31 02:22:31 +01:00
// remove ending backslash
if (buffer[strlen(buffer)-1] == '\\')
buffer[strlen(buffer)-1] = '\0';
Fixes for OS2. Fix bug in isamlog Add argument types to function declarations. Docs/manual.texi: Updated credits client/mysql.cc: Fixes for OS2 client/mysqladmin.c: Fixes for OS2 client/mysqldump.c: Fixes for OS2 client/mysqlimport.c: Fixes for OS2 client/mysqltest.c: Fixes for OS2 dbug/dbug.c: Fixes for OS2. Use new C calling convention. dbug/factorial.c: Fixes for OS2. Use new C calling convention. include/errmsg.h: Fix for OS2 include/global.h: Fixes for OS2. include/my_pthread.h: Fixes for OS2. include/my_sys.h: Fixes for OS2. include/mysql_com.h: Move defines to global.h include/thr_alarm.h: Fixes for OS2. isam/isamchk.c: Fixes for OS2. Add arguments to function declarations. isam/isamlog.c: Fixes for OS2. Fix bug in logfile handling. isam/test1.c: Add arguments to function decl isam/test2.c: Add arguments to function declarations. isam/test_all.res: Update result libmysql/get_password.c: Fixes for OS2. libmysql/libmysql.c: Fixes for OS2. libmysql/net.c: Fixes for OS2. libmysql/violite.c: Add arguments to function declarations. merge/_locking.c: Add argument types to function declarations. merge/close.c: Add argument types to function declarations. merge/create.c: Add argument types to function declarations. merge/extra.c: Add argument types to function declarations. merge/open.c: Add argument types to function declarations. merge/panic.c: Add argument types to function declarations. merge/rsame.c: Add argument types to function declarations. merge/update.c: Add argument types to function declarations. myisam/ft_eval.c: Portability fix myisam/ft_search.c: Portability fix myisam/ft_test1.c: Portability fix myisam/ftdefs.h: Portability fix myisam/mi_check.c: Portability fix myisam/mi_test1.c: Portability fix myisam/mi_test2.c: Portability fix myisam/mi_test_all.sh: Update to test for MACH variable myisam/myisamlog.c: Cleanup myisam/myisampack.c: Don't use variable 'new' myisam/sort.c: Portability fix myisammrg/myrg_delete.c: Add argument types to function declarations. myisammrg/myrg_locking.c: Add argument types to function declarations. myisammrg/myrg_open.c: Add argument types to function declarations. myisammrg/myrg_panic.c: Add argument types to function declarations. mysql-test/t/backup.test: Fix for OS2 mysql-test/t/show_check.test: Fix for OS2 mysys/charset.c: Dont use variable 'new' mysys/default.c: Fixes for OS2. mysys/getopt.c: Fixes for OS2. mysys/getopt1.c: Fixes for OS2. mysys/list.c: Don't use variable 'new' mysys/mf_dirname.c: Fixes for OS2. mysys/mf_format.c: Fixes for OS2. mysys/mf_path.c: Fixes for OS2. mysys/mf_qsort.c: Portability fix mysys/mf_tempfile.c: Fixes for OS2. mysys/my_clock.c: Fixes for OS2. mysys/my_copy.c: Fixes for OS2. mysys/my_create.c: Fixes for OS2. mysys/my_getwd.c: Fixes for OS2. mysys/my_init.c: Fixes for OS2. mysys/my_lib.c: Fixes for OS2. mysys/my_lock.c: Fixes for OS2. mysys/my_malloc.c: Portability fix mysys/my_mkdir.c: Fixes for OS2. mysys/my_open.c: Fixes for OS2. mysys/my_pthread.c: Fixes for OS2. mysys/my_realloc.c: Fixes for OS2. mysys/my_redel.c: Fixes for OS2. mysys/my_static.c: Fixes for OS2. mysys/my_tempnam.c: Fixes for OS2. mysys/my_thr_init.c: Fixes for OS2. mysys/my_write.c: Fixes for OS2. mysys/test_charset.c: Fixes for OS2. mysys/thr_alarm.c: Fixes for OS2. mysys/tree.c: Fixes for OS2. sql/field.cc: Fixes for OS2. sql/field.h: Fixes for OS2. sql/gen_lex_hash.cc: Fixes for OS2. sql/hostname.cc: Fixes for OS2. sql/item_func.cc: Fixes for OS2. sql/item_strfunc.cc: Fixes for OS2. sql/log_event.cc: Fixes for OS2. sql/md5.c: Fixes for OS2. sql/mini_client.cc: Fixes for OS2. sql/mysql_priv.h: Fixes for OS2. sql/mysqld.cc: Fixes for OS2. sql/net_serv.cc: Fixes for OS2. sql/slave.cc: Fixes for OS2. sql/sql_base.cc: Fixes for OS2. sql/sql_db.cc: Portability fix sql/sql_insert.cc: Fixes for OS2. sql/sql_load.cc: Fixes for OS2. sql/sql_parse.cc: Fixes for OS2. sql/sql_table.cc: Fixes for OS2. sql/sql_udf.cc: Fixes for OS2. sql/violite.c: Fixes for OS2. strings/ctype-big5.c: Fixes for OS2. strings/ctype-gbk.c: Fixes for OS2. strings/ctype-sjis.c: Fixes for OS2. strings/ctype-tis620.c: Fixes for OS2. strings/ctype.c: Fixes for OS2. strings/strnlen.c: Fixes for OS2.
2001-08-22 00:45:07 +02:00
putenv( buffer);
#else
old_env= (char**) environ;
if (dir)
{ /* Don't use TMPDIR if dir is given */
Fixes for OS2. Fix bug in isamlog Add argument types to function declarations. Docs/manual.texi: Updated credits client/mysql.cc: Fixes for OS2 client/mysqladmin.c: Fixes for OS2 client/mysqldump.c: Fixes for OS2 client/mysqlimport.c: Fixes for OS2 client/mysqltest.c: Fixes for OS2 dbug/dbug.c: Fixes for OS2. Use new C calling convention. dbug/factorial.c: Fixes for OS2. Use new C calling convention. include/errmsg.h: Fix for OS2 include/global.h: Fixes for OS2. include/my_pthread.h: Fixes for OS2. include/my_sys.h: Fixes for OS2. include/mysql_com.h: Move defines to global.h include/thr_alarm.h: Fixes for OS2. isam/isamchk.c: Fixes for OS2. Add arguments to function declarations. isam/isamlog.c: Fixes for OS2. Fix bug in logfile handling. isam/test1.c: Add arguments to function decl isam/test2.c: Add arguments to function declarations. isam/test_all.res: Update result libmysql/get_password.c: Fixes for OS2. libmysql/libmysql.c: Fixes for OS2. libmysql/net.c: Fixes for OS2. libmysql/violite.c: Add arguments to function declarations. merge/_locking.c: Add argument types to function declarations. merge/close.c: Add argument types to function declarations. merge/create.c: Add argument types to function declarations. merge/extra.c: Add argument types to function declarations. merge/open.c: Add argument types to function declarations. merge/panic.c: Add argument types to function declarations. merge/rsame.c: Add argument types to function declarations. merge/update.c: Add argument types to function declarations. myisam/ft_eval.c: Portability fix myisam/ft_search.c: Portability fix myisam/ft_test1.c: Portability fix myisam/ftdefs.h: Portability fix myisam/mi_check.c: Portability fix myisam/mi_test1.c: Portability fix myisam/mi_test2.c: Portability fix myisam/mi_test_all.sh: Update to test for MACH variable myisam/myisamlog.c: Cleanup myisam/myisampack.c: Don't use variable 'new' myisam/sort.c: Portability fix myisammrg/myrg_delete.c: Add argument types to function declarations. myisammrg/myrg_locking.c: Add argument types to function declarations. myisammrg/myrg_open.c: Add argument types to function declarations. myisammrg/myrg_panic.c: Add argument types to function declarations. mysql-test/t/backup.test: Fix for OS2 mysql-test/t/show_check.test: Fix for OS2 mysys/charset.c: Dont use variable 'new' mysys/default.c: Fixes for OS2. mysys/getopt.c: Fixes for OS2. mysys/getopt1.c: Fixes for OS2. mysys/list.c: Don't use variable 'new' mysys/mf_dirname.c: Fixes for OS2. mysys/mf_format.c: Fixes for OS2. mysys/mf_path.c: Fixes for OS2. mysys/mf_qsort.c: Portability fix mysys/mf_tempfile.c: Fixes for OS2. mysys/my_clock.c: Fixes for OS2. mysys/my_copy.c: Fixes for OS2. mysys/my_create.c: Fixes for OS2. mysys/my_getwd.c: Fixes for OS2. mysys/my_init.c: Fixes for OS2. mysys/my_lib.c: Fixes for OS2. mysys/my_lock.c: Fixes for OS2. mysys/my_malloc.c: Portability fix mysys/my_mkdir.c: Fixes for OS2. mysys/my_open.c: Fixes for OS2. mysys/my_pthread.c: Fixes for OS2. mysys/my_realloc.c: Fixes for OS2. mysys/my_redel.c: Fixes for OS2. mysys/my_static.c: Fixes for OS2. mysys/my_tempnam.c: Fixes for OS2. mysys/my_thr_init.c: Fixes for OS2. mysys/my_write.c: Fixes for OS2. mysys/test_charset.c: Fixes for OS2. mysys/thr_alarm.c: Fixes for OS2. mysys/tree.c: Fixes for OS2. sql/field.cc: Fixes for OS2. sql/field.h: Fixes for OS2. sql/gen_lex_hash.cc: Fixes for OS2. sql/hostname.cc: Fixes for OS2. sql/item_func.cc: Fixes for OS2. sql/item_strfunc.cc: Fixes for OS2. sql/log_event.cc: Fixes for OS2. sql/md5.c: Fixes for OS2. sql/mini_client.cc: Fixes for OS2. sql/mysql_priv.h: Fixes for OS2. sql/mysqld.cc: Fixes for OS2. sql/net_serv.cc: Fixes for OS2. sql/slave.cc: Fixes for OS2. sql/sql_base.cc: Fixes for OS2. sql/sql_db.cc: Portability fix sql/sql_insert.cc: Fixes for OS2. sql/sql_load.cc: Fixes for OS2. sql/sql_parse.cc: Fixes for OS2. sql/sql_table.cc: Fixes for OS2. sql/sql_udf.cc: Fixes for OS2. sql/violite.c: Fixes for OS2. strings/ctype-big5.c: Fixes for OS2. strings/ctype-gbk.c: Fixes for OS2. strings/ctype-sjis.c: Fixes for OS2. strings/ctype-tis620.c: Fixes for OS2. strings/ctype.c: Fixes for OS2. strings/strnlen.c: Fixes for OS2.
2001-08-22 00:45:07 +02:00
environ=(const char**) temp_env;
temp_env[0]=0;
}
Fixes for OS2. Fix bug in isamlog Add argument types to function declarations. Docs/manual.texi: Updated credits client/mysql.cc: Fixes for OS2 client/mysqladmin.c: Fixes for OS2 client/mysqldump.c: Fixes for OS2 client/mysqlimport.c: Fixes for OS2 client/mysqltest.c: Fixes for OS2 dbug/dbug.c: Fixes for OS2. Use new C calling convention. dbug/factorial.c: Fixes for OS2. Use new C calling convention. include/errmsg.h: Fix for OS2 include/global.h: Fixes for OS2. include/my_pthread.h: Fixes for OS2. include/my_sys.h: Fixes for OS2. include/mysql_com.h: Move defines to global.h include/thr_alarm.h: Fixes for OS2. isam/isamchk.c: Fixes for OS2. Add arguments to function declarations. isam/isamlog.c: Fixes for OS2. Fix bug in logfile handling. isam/test1.c: Add arguments to function decl isam/test2.c: Add arguments to function declarations. isam/test_all.res: Update result libmysql/get_password.c: Fixes for OS2. libmysql/libmysql.c: Fixes for OS2. libmysql/net.c: Fixes for OS2. libmysql/violite.c: Add arguments to function declarations. merge/_locking.c: Add argument types to function declarations. merge/close.c: Add argument types to function declarations. merge/create.c: Add argument types to function declarations. merge/extra.c: Add argument types to function declarations. merge/open.c: Add argument types to function declarations. merge/panic.c: Add argument types to function declarations. merge/rsame.c: Add argument types to function declarations. merge/update.c: Add argument types to function declarations. myisam/ft_eval.c: Portability fix myisam/ft_search.c: Portability fix myisam/ft_test1.c: Portability fix myisam/ftdefs.h: Portability fix myisam/mi_check.c: Portability fix myisam/mi_test1.c: Portability fix myisam/mi_test2.c: Portability fix myisam/mi_test_all.sh: Update to test for MACH variable myisam/myisamlog.c: Cleanup myisam/myisampack.c: Don't use variable 'new' myisam/sort.c: Portability fix myisammrg/myrg_delete.c: Add argument types to function declarations. myisammrg/myrg_locking.c: Add argument types to function declarations. myisammrg/myrg_open.c: Add argument types to function declarations. myisammrg/myrg_panic.c: Add argument types to function declarations. mysql-test/t/backup.test: Fix for OS2 mysql-test/t/show_check.test: Fix for OS2 mysys/charset.c: Dont use variable 'new' mysys/default.c: Fixes for OS2. mysys/getopt.c: Fixes for OS2. mysys/getopt1.c: Fixes for OS2. mysys/list.c: Don't use variable 'new' mysys/mf_dirname.c: Fixes for OS2. mysys/mf_format.c: Fixes for OS2. mysys/mf_path.c: Fixes for OS2. mysys/mf_qsort.c: Portability fix mysys/mf_tempfile.c: Fixes for OS2. mysys/my_clock.c: Fixes for OS2. mysys/my_copy.c: Fixes for OS2. mysys/my_create.c: Fixes for OS2. mysys/my_getwd.c: Fixes for OS2. mysys/my_init.c: Fixes for OS2. mysys/my_lib.c: Fixes for OS2. mysys/my_lock.c: Fixes for OS2. mysys/my_malloc.c: Portability fix mysys/my_mkdir.c: Fixes for OS2. mysys/my_open.c: Fixes for OS2. mysys/my_pthread.c: Fixes for OS2. mysys/my_realloc.c: Fixes for OS2. mysys/my_redel.c: Fixes for OS2. mysys/my_static.c: Fixes for OS2. mysys/my_tempnam.c: Fixes for OS2. mysys/my_thr_init.c: Fixes for OS2. mysys/my_write.c: Fixes for OS2. mysys/test_charset.c: Fixes for OS2. mysys/thr_alarm.c: Fixes for OS2. mysys/tree.c: Fixes for OS2. sql/field.cc: Fixes for OS2. sql/field.h: Fixes for OS2. sql/gen_lex_hash.cc: Fixes for OS2. sql/hostname.cc: Fixes for OS2. sql/item_func.cc: Fixes for OS2. sql/item_strfunc.cc: Fixes for OS2. sql/log_event.cc: Fixes for OS2. sql/md5.c: Fixes for OS2. sql/mini_client.cc: Fixes for OS2. sql/mysql_priv.h: Fixes for OS2. sql/mysqld.cc: Fixes for OS2. sql/net_serv.cc: Fixes for OS2. sql/slave.cc: Fixes for OS2. sql/sql_base.cc: Fixes for OS2. sql/sql_db.cc: Portability fix sql/sql_insert.cc: Fixes for OS2. sql/sql_load.cc: Fixes for OS2. sql/sql_parse.cc: Fixes for OS2. sql/sql_table.cc: Fixes for OS2. sql/sql_udf.cc: Fixes for OS2. sql/violite.c: Fixes for OS2. strings/ctype-big5.c: Fixes for OS2. strings/ctype-gbk.c: Fixes for OS2. strings/ctype-sjis.c: Fixes for OS2. strings/ctype-tis620.c: Fixes for OS2. strings/ctype.c: Fixes for OS2. strings/strnlen.c: Fixes for OS2.
2001-08-22 00:45:07 +02:00
#endif
if ((res=tempnam((char*) dir, (char*) prefix)))
{
strmake(to,res,FN_REFLEN-1);
(*free)(res);
file=my_create(to,0,
(int) (O_RDWR | O_BINARY | O_TRUNC |
O_TEMPORARY | O_SHORT_LIVED),
MYF(MY_WME));
}
else
{
DBUG_PRINT("error",("Got error: %d from tempnam",errno));
}
Fixes for OS2. Fix bug in isamlog Add argument types to function declarations. Docs/manual.texi: Updated credits client/mysql.cc: Fixes for OS2 client/mysqladmin.c: Fixes for OS2 client/mysqldump.c: Fixes for OS2 client/mysqlimport.c: Fixes for OS2 client/mysqltest.c: Fixes for OS2 dbug/dbug.c: Fixes for OS2. Use new C calling convention. dbug/factorial.c: Fixes for OS2. Use new C calling convention. include/errmsg.h: Fix for OS2 include/global.h: Fixes for OS2. include/my_pthread.h: Fixes for OS2. include/my_sys.h: Fixes for OS2. include/mysql_com.h: Move defines to global.h include/thr_alarm.h: Fixes for OS2. isam/isamchk.c: Fixes for OS2. Add arguments to function declarations. isam/isamlog.c: Fixes for OS2. Fix bug in logfile handling. isam/test1.c: Add arguments to function decl isam/test2.c: Add arguments to function declarations. isam/test_all.res: Update result libmysql/get_password.c: Fixes for OS2. libmysql/libmysql.c: Fixes for OS2. libmysql/net.c: Fixes for OS2. libmysql/violite.c: Add arguments to function declarations. merge/_locking.c: Add argument types to function declarations. merge/close.c: Add argument types to function declarations. merge/create.c: Add argument types to function declarations. merge/extra.c: Add argument types to function declarations. merge/open.c: Add argument types to function declarations. merge/panic.c: Add argument types to function declarations. merge/rsame.c: Add argument types to function declarations. merge/update.c: Add argument types to function declarations. myisam/ft_eval.c: Portability fix myisam/ft_search.c: Portability fix myisam/ft_test1.c: Portability fix myisam/ftdefs.h: Portability fix myisam/mi_check.c: Portability fix myisam/mi_test1.c: Portability fix myisam/mi_test2.c: Portability fix myisam/mi_test_all.sh: Update to test for MACH variable myisam/myisamlog.c: Cleanup myisam/myisampack.c: Don't use variable 'new' myisam/sort.c: Portability fix myisammrg/myrg_delete.c: Add argument types to function declarations. myisammrg/myrg_locking.c: Add argument types to function declarations. myisammrg/myrg_open.c: Add argument types to function declarations. myisammrg/myrg_panic.c: Add argument types to function declarations. mysql-test/t/backup.test: Fix for OS2 mysql-test/t/show_check.test: Fix for OS2 mysys/charset.c: Dont use variable 'new' mysys/default.c: Fixes for OS2. mysys/getopt.c: Fixes for OS2. mysys/getopt1.c: Fixes for OS2. mysys/list.c: Don't use variable 'new' mysys/mf_dirname.c: Fixes for OS2. mysys/mf_format.c: Fixes for OS2. mysys/mf_path.c: Fixes for OS2. mysys/mf_qsort.c: Portability fix mysys/mf_tempfile.c: Fixes for OS2. mysys/my_clock.c: Fixes for OS2. mysys/my_copy.c: Fixes for OS2. mysys/my_create.c: Fixes for OS2. mysys/my_getwd.c: Fixes for OS2. mysys/my_init.c: Fixes for OS2. mysys/my_lib.c: Fixes for OS2. mysys/my_lock.c: Fixes for OS2. mysys/my_malloc.c: Portability fix mysys/my_mkdir.c: Fixes for OS2. mysys/my_open.c: Fixes for OS2. mysys/my_pthread.c: Fixes for OS2. mysys/my_realloc.c: Fixes for OS2. mysys/my_redel.c: Fixes for OS2. mysys/my_static.c: Fixes for OS2. mysys/my_tempnam.c: Fixes for OS2. mysys/my_thr_init.c: Fixes for OS2. mysys/my_write.c: Fixes for OS2. mysys/test_charset.c: Fixes for OS2. mysys/thr_alarm.c: Fixes for OS2. mysys/tree.c: Fixes for OS2. sql/field.cc: Fixes for OS2. sql/field.h: Fixes for OS2. sql/gen_lex_hash.cc: Fixes for OS2. sql/hostname.cc: Fixes for OS2. sql/item_func.cc: Fixes for OS2. sql/item_strfunc.cc: Fixes for OS2. sql/log_event.cc: Fixes for OS2. sql/md5.c: Fixes for OS2. sql/mini_client.cc: Fixes for OS2. sql/mysql_priv.h: Fixes for OS2. sql/mysqld.cc: Fixes for OS2. sql/net_serv.cc: Fixes for OS2. sql/slave.cc: Fixes for OS2. sql/sql_base.cc: Fixes for OS2. sql/sql_db.cc: Portability fix sql/sql_insert.cc: Fixes for OS2. sql/sql_load.cc: Fixes for OS2. sql/sql_parse.cc: Fixes for OS2. sql/sql_table.cc: Fixes for OS2. sql/sql_udf.cc: Fixes for OS2. sql/violite.c: Fixes for OS2. strings/ctype-big5.c: Fixes for OS2. strings/ctype-gbk.c: Fixes for OS2. strings/ctype-sjis.c: Fixes for OS2. strings/ctype-tis620.c: Fixes for OS2. strings/ctype.c: Fixes for OS2. strings/strnlen.c: Fixes for OS2.
2001-08-22 00:45:07 +02:00
#ifndef OS2
environ=(const char**) old_env;
#endif
}
#else
{
register long uniq;
register int length;
my_string pos,end_pos;
/* Make an unique number */
pthread_mutex_lock(&THR_LOCK_open);
uniq= ((long) getpid() << 20) + (long) _my_tempnam_used++ ;
pthread_mutex_unlock(&THR_LOCK_open);
if (!dir && !(dir=getenv("TMPDIR"))) /* Use this if possibly */
dir=P_tmpdir; /* Use system default */
length=strlen(dir)+strlen(pfx)+1;
DBUG_PRINT("test",("mallocing %d byte",length+8+sizeof(TMP_EXT)+1));
if (length+8+sizeof(TMP_EXT)+1 > FN_REFLENGTH)
errno=my_errno= ENAMETOOLONG;
else
{
end_pos=strmov(to,dir);
if (end_pos != to && end_pos[-1] != FN_LIBCHAR)
*end_pos++=FN_LIBCHAR;
end_pos=strmov(end_pos,pfx);
for (length=0 ; length < 8 && uniq ; length++)
{
*end_pos++= _dig_vec[(int) (uniq & 31)];
uniq >>= 5;
}
(void) strmov(end_pos,TMP_EXT);
file=my_create(to,0,
(int) (O_RDWR | O_BINARY | O_TRUNC |
O_TEMPORARY | O_SHORT_LIVED),
MYF(MY_WME));
}
}
#endif
if (file >= 0)
thread_safe_increment(my_tmp_file_created,&THR_LOCK_open);
DBUG_RETURN(file);
}