summaryrefslogtreecommitdiff
path: root/mysys/mf_format.c
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2001-05-31 14:07:17 +0300
committermonty@hundin.mysql.fi <>2001-05-31 14:07:17 +0300
commitb7c3a28149c2e3a7fddb0f0b99104c87c980c5bf (patch)
treef19c68fd5b7d68ad4f7919cb8e6eae7d6961956e /mysys/mf_format.c
parentaec1ed037a7debd0ec9d24acdcc152a7569bcae3 (diff)
downloadmariadb-git-b7c3a28149c2e3a7fddb0f0b99104c87c980c5bf.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
Diffstat (limited to 'mysys/mf_format.c')
-rw-r--r--mysys/mf_format.c29
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 */