Commit f073148f authored by unknown's avatar unknown

Fixed bugs in symlink code


client/errmsg.c:
  Added portuguese error messages.
parent 740a7e58
......@@ -48,6 +48,34 @@ const char *client_errors[]=
"Got packet bigger than 'max_allowed_packet'"
};
/* Start of code added by Roberto M. Serqueira - martinsc@uol.com.br - 05.24.2001 */
#elif defined PORTUGUESE
const char *client_errors[]=
{
"Erro desconhecido do MySQL",
"No pode criar 'UNIX socket' (%d)",
"No pode se conectar ao servidor MySQL local atravs do 'socket' '%-.64s' (%d)",
"No pode se conectar ao servidor MySQL em '%-.64s' (%d)",
"No pode criar 'socket TCP/IP' (%d)",
"'Host' servidor MySQL '%-.64s' (%d) desconhecido",
"Servidor MySQL desapareceu",
"Incompatibilidade de protocolos. Verso do Servidor: %d - Verso do Cliente: %d",
"Cliente do MySQL com falta de memria",
"Informao invlida de 'host'",
"Localhost via 'UNIX socket'",
"%-.64s via 'TCP/IP'",
"Erro na negociao de acesso ao servidor",
"Conexo perdida com servidor MySQL durante 'query'",
"Comandos fora de sincronismo. Voc no pode executar este comando agora",
"%-.64s via 'named pipe'",
"No pode esperar pelo 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)",
"No pode abrir 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)",
"No pode estabelecer o estado do 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)",
"No pode inicializar conjunto de caracteres %-.64s (caminho %-.64s)",
"Obteve pacote maior do que 'max_allowed_packet'"
};
#else /* ENGLISH */
const char *client_errors[]=
{
......
......@@ -87,13 +87,13 @@ int my_delete_with_symlink(const char *name, myf MyFlags)
int my_rename_with_symlink(const char *from, const char *to, myf MyFlags)
{
#ifdef HAVE_READLINK
#ifndef HAVE_READLINK
return my_rename(from, to, MyFlags);
#else
char link_name[FN_REFLEN], tmp_name[FN_REFLEN];
int was_symlink= (!my_disable_symlinks &&
!my_readlink(link_name, name, MYF(0)));
int result;
!my_readlink(link_name, from, MYF(0)));
int result=0;
DBUG_ENTER("my_rename_with_symlink");
if (!was_symlink)
......@@ -105,7 +105,7 @@ int my_rename_with_symlink(const char *from, const char *to, myf MyFlags)
/* Create new symlink */
if (my_symlink(tmp_name, to, MyFlags))
DBUG_RETURN(-1);
DBUG_RETURN(1);
/*
Rename symlinked file if the base name didn't change.
......@@ -115,18 +115,23 @@ int my_rename_with_symlink(const char *from, const char *to, myf MyFlags)
if (strcmp(link_name, tmp_name) && my_rename(link_name, tmp_name, MyFlags))
{
int save_errno=my_errno;
my_delete(to, MyFlags); /* Remove created symlink */
DBUG_RETURN(-1);
my_errno=save_errno;
DBUG_RETURN(1);
}
/* Remove original symlink */
if (my_delete(from, MyFlags))
{
int save_errno=my_errno;
/* Remove created link */
my_delete(to, MyFlags);
/* Rename file back */
if (strcmp(link_name, tmp_name))
(void) my_rename(tmp_name, link_name, MyFlags);
my_errno=save_errno;
result= 1;
}
DBUG_RETURN(result);
#endif /* HAVE_READLINK */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment