diff options
author | unknown <monty@donna.mysql.com> | 2001-01-27 01:20:56 +0200 |
---|---|---|
committer | unknown <monty@donna.mysql.com> | 2001-01-27 01:20:56 +0200 |
commit | 52a4c5a10063f2e7b06a32add3b87ba0b0ae2b45 (patch) | |
tree | bf79d814679a767435990f41e226728ee5927766 /myisammrg | |
parent | 002b51000fcec9ff8c45afe12ddd3728f6035ff0 (diff) | |
download | mariadb-git-52a4c5a10063f2e7b06a32add3b87ba0b0ae2b45.tar.gz |
Portability fixes for OPENBSD, OS2 and Windows
Docs/manual.texi:
Changed TCX -> MySQL AB
configure.in:
New version
include/my_sys.h:
Fixes for OS2
ltconfig:
Fixes for OS2
ltmain.sh:
Fixes for OS2
mit-pthreads/net/net_internal.h:
Fixes for OPENBSD
mit-pthreads/net/proto_internal.h:
Fixes for OPENBSD
mit-pthreads/net/res_internal.h:
Fixes for OPENBSD
mit-pthreads/net/serv_internal.h:
Fixes for OPENBSD
myisammrg/myrg_open.c:
MERGE didn't work on Windows
mysys/my_getwd.c:
Fixes for OS2
sql/field.cc:
cleanup
sql/field.h:
Fix for new SCO compiler
sql/ha_berkeley.cc:
Cleanup
sql/ha_berkeley.h:
Portability fix
sql/item_sum.h:
Fix for new SCO compiler
sql/log.cc:
Fixes for OS2
sql/log_event.h:
Fixes for OS2
sql/mysqld.cc:
Fixes for OS2
sql/net_serv.cc:
Fixes for OS2
sql/sql_analyse.h:
Fix for new SCO compiler
sql/sql_class.h:
Fix for new SCO compiler
sql/sql_map.h:
Fix for new SCO compiler
sql/sql_repl.cc:
cleanup
sql/sql_string.h:
Fix for new SCO compiler
sql/sql_table.cc:
cleanup
strings/longlong2str-x86.s:
Fixes for openbsd
Diffstat (limited to 'myisammrg')
-rw-r--r-- | myisammrg/myrg_open.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/myisammrg/myrg_open.c b/myisammrg/myrg_open.c index f0a2b4348f6..f73339f63c8 100644 --- a/myisammrg/myrg_open.c +++ b/myisammrg/myrg_open.c @@ -36,11 +36,12 @@ int mode; int handle_locking; { int save_errno,i,errpos; - uint files,dir_length; + uint files,dir_length,length; ulonglong file_offset; char name_buff[FN_REFLEN*2],buff[FN_REFLEN],*end; MYRG_INFO info,*m_info; - FILE *file; + File fd; + IO_CACHE file; MI_INFO *isam,*last_isam; DBUG_ENTER("myrg_open"); @@ -49,15 +50,18 @@ int handle_locking; isam=0; errpos=files=0; bzero((gptr) &info,sizeof(info)); - if (!(file=my_fopen(fn_format(name_buff,name,"",MYRG_NAME_EXT,4), - O_RDONLY | O_SHARE,MYF(0)))) + bzero((char*) &file,sizeof(file)); + if ((fd=my_open(fn_format(name_buff,name,"",MYRG_NAME_EXT,4), + O_RDONLY | O_SHARE,MYF(0))) < 0 || + init_io_cache(&file, fd, IO_SIZE, READ_CACHE, 0, 0, + MYF(MY_WME | MY_NABP))) goto err; errpos=1; dir_length=dirname_part(name_buff,name); info.reclength=0; - while (fgets(buff,FN_REFLEN-1,file)) + while ((length=my_b_gets(&file,buff,FN_REFLEN-1))) { - if ((end=strend(buff))[-1] == '\n') + if ((end=buff+length)[-1] == '\n') end[-1]='\0'; if (buff[0] && buff[0] != '#') /* Skipp empty lines and comments */ { @@ -118,7 +122,8 @@ int handle_locking; m_info->end_table=m_info->open_tables+files; m_info->last_used_table=m_info->open_tables; - VOID(my_fclose(file,MYF(0))); + VOID(my_close(fd,MYF(0))); + end_io_cache(&file); m_info->open_list.data=(void*) m_info; pthread_mutex_lock(&THR_LOCK_open); myrg_open_list=list_add(myrg_open_list,&m_info->open_list); @@ -132,7 +137,8 @@ err: my_free((char*) m_info,MYF(0)); /* Fall through */ case 1: - VOID(my_fclose(file,MYF(0))); + VOID(my_close(fd,MYF(0))); + end_io_cache(&file); for (i=files ; i-- > 0 ; ) { isam=last_isam; |