diff options
author | unknown <monty@hundin.mysql.fi> | 2001-05-31 14:07:17 +0300 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2001-05-31 14:07:17 +0300 |
commit | d9a9f38e870f24c4bc148ed58333abaedad81f05 (patch) | |
tree | f19c68fd5b7d68ad4f7919cb8e6eae7d6961956e /mysys/mf_format.c | |
parent | 5ec74dda9bb5970f8fbba559e47c19a2b6e91561 (diff) | |
download | mariadb-git-d9a9f38e870f24c4bc148ed58333abaedad81f05.tar.gz |
Removed compiler warnings.
Added preliminary handling of symlinks in MyISAM.
When using myisamchk to check tables with --force, don't repair
tables that are marked as 'not closed' if they are ok.
Change fn_format() to use my_real_path and my_symlink
include/myisam.h:
Added handling of symlinks
myisam/ft_boolean_search.c:
cleanup
myisam/ft_dump.c:
cleanup
myisam/mi_check.c:
Added handling of symlinks.
When using check and --force, don't repair tables that are marked
as 'not closed' if they are ok.
myisam/mi_create.c:
Added handling of symlinks.
myisam/mi_dbug.c:
Added handling of symlinks.
myisam/mi_info.c:
Added handling of symlinks.
myisam/mi_open.c:
Added handling of symlinks.
myisam/mi_search.c:
cleanup
myisam/myisamchk.c:
Added handling of symlinks.
myisam/myisamdef.h:
Added handling of symlinks.
myisam/myisamlog.c:
Fixed bug when using new trees
myisam/myisampack.c:
cleanup
mysys/mf_cache.c:
cleanup
mysys/mf_format.c:
Change to use my_real_path and my_symlink
mysys/my_alloc.c:
cleanup
BitKeeper/etc/ignore:
Added libmysqld/sql_command libmysqld/backup_dir libmysqld/simple-test to the ignore list
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
Diffstat (limited to 'mysys/mf_format.c')
-rw-r--r-- | mysys/mf_format.c | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/mysys/mf_format.c b/mysys/mf_format.c index c4425806e01..216608fdee5 100644 --- a/mysys/mf_format.c +++ b/mysys/mf_format.c @@ -17,10 +17,6 @@ #include "mysys_priv.h" #include <m_string.h> -#ifdef HAVE_REALPATH -#include <sys/param.h> -#include <sys/stat.h> -#endif /* format a filename with replace of library and extension */ /* params to and name may be identicall */ @@ -33,21 +29,12 @@ /* 32 Resolve filename to full path */ /* 64 Return NULL if too long path */ -#ifdef SCO -#define BUFF_LEN 4097 -#else -#ifdef MAXPATHLEN -#define BUFF_LEN MAXPATHLEN -#else -#define BUFF_LEN FN_LEN -#endif -#endif my_string fn_format(my_string to, const char *name, const char *dsk, const char *form, int flag) { reg1 uint length; - char dev[FN_REFLEN], buff[BUFF_LEN], *pos, *startpos; + char dev[FN_REFLEN], buff[FN_REFLEN], *pos, *startpos; const char *ext; DBUG_ENTER("fn_format"); DBUG_PRINT("enter",("name: %s dsk: %s form: %s flag: %d", @@ -109,18 +96,14 @@ my_string fn_format(my_string to, const char *name, const char *dsk, #endif (void) strmov(pos,ext); /* Don't convert extension */ } - /* Purify gives a lot of UMR errors when using realpath */ -#if defined(HAVE_REALPATH) && !defined(HAVE_purify) && !defined(HAVE_BROKEN_REALPATH) if (flag & 16) { - struct stat stat_buff; - if (flag & 32 || (!lstat(to,&stat_buff) && S_ISLNK(stat_buff.st_mode))) - { - if (realpath(to,buff)) - strmake(to,buff,FN_REFLEN-1); - } + strmov(buff,to); + my_symlink(to, buff, MYF(flag & 32 ? 0 : MY_RESOLVE_LINK)); } -#endif + else if (flag & 32) + my_realpath(to, to, MYF(flag & 32 ? 0 : MY_RESOLVE_LINK)); + DBUG_RETURN (to); } /* fn_format */ |