mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
Fixed bugs in symlink code
client/errmsg.c: Added portuguese error messages.
This commit is contained in:
@@ -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",
|
||||
"N<EFBFBD>o pode criar 'UNIX socket' (%d)",
|
||||
"N<EFBFBD>o pode se conectar ao servidor MySQL local atrav<61>s do 'socket' '%-.64s' (%d)",
|
||||
"N<EFBFBD>o pode se conectar ao servidor MySQL em '%-.64s' (%d)",
|
||||
"N<EFBFBD>o pode criar 'socket TCP/IP' (%d)",
|
||||
"'Host' servidor MySQL '%-.64s' (%d) desconhecido",
|
||||
"Servidor MySQL desapareceu",
|
||||
"Incompatibilidade de protocolos. Vers<72>o do Servidor: %d - Vers<72>o do Cliente: %d",
|
||||
"Cliente do MySQL com falta de mem<65>ria",
|
||||
"Informa<EFBFBD><EFBFBD>o inv<6E>lida de 'host'",
|
||||
"Localhost via 'UNIX socket'",
|
||||
"%-.64s via 'TCP/IP'",
|
||||
"Erro na negocia<69><61>o de acesso ao servidor",
|
||||
"Conex<EFBFBD>o perdida com servidor MySQL durante 'query'",
|
||||
"Comandos fora de sincronismo. Voc<6F> n<>o pode executar este comando agora",
|
||||
"%-.64s via 'named pipe'",
|
||||
"N<EFBFBD>o pode esperar pelo 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)",
|
||||
"N<EFBFBD>o pode abrir 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)",
|
||||
"N<EFBFBD>o pode estabelecer o estado do 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)",
|
||||
"N<EFBFBD>o 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 */
|
||||
|
Reference in New Issue
Block a user