mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
cleanup: my_strerror
This commit is contained in:
parent
590d473760
commit
46ae210422
3 changed files with 9 additions and 10 deletions
|
|
@ -698,7 +698,7 @@ extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
|
|||
extern FILE *my_freopen(const char *path, const char *mode, FILE *stream);
|
||||
extern int my_fclose(FILE *fd,myf MyFlags);
|
||||
extern int my_vfprintf(FILE *stream, const char* format, va_list args);
|
||||
extern void my_strerror(char *buf, size_t len, int nr);
|
||||
extern const char* my_strerror(char *buf, size_t len, int nr);
|
||||
extern int my_fprintf(FILE *stream, const char* format, ...);
|
||||
extern File my_fileno(FILE *fd);
|
||||
extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags);
|
||||
|
|
|
|||
|
|
@ -2619,11 +2619,10 @@ innobase_mysql_tmpfile(
|
|||
char errbuf[MYSYS_STRERROR_SIZE];
|
||||
DBUG_PRINT("error",("Got error %d on dup",fd2));
|
||||
set_my_errno(errno);
|
||||
my_strerror(errbuf, sizeof(errbuf), my_errno);
|
||||
my_error(EE_OUT_OF_FILERESOURCES,
|
||||
MYF(0),
|
||||
"ib*", my_errno,
|
||||
errbuf);
|
||||
"ib*", errno,
|
||||
my_strerror(errbuf, sizeof(errbuf), errno));
|
||||
}
|
||||
my_close(fd, MYF(MY_WME));
|
||||
}
|
||||
|
|
@ -16092,8 +16091,7 @@ ha_innobase::info_low(
|
|||
char errbuf[MYSYS_STRERROR_SIZE];
|
||||
|
||||
thd = ha_thd();
|
||||
my_strerror(errbuf, sizeof(errbuf),
|
||||
errno);
|
||||
|
||||
push_warning_printf(
|
||||
thd,
|
||||
Sql_condition::WARN_LEVEL_WARN,
|
||||
|
|
@ -16105,8 +16103,8 @@ ha_innobase::info_low(
|
|||
" the free space to zero."
|
||||
" (errno: %d - %s)",
|
||||
ib_table->name.m_name, errno,
|
||||
errbuf);
|
||||
|
||||
my_strerror(errbuf, sizeof(errbuf),
|
||||
errno));
|
||||
|
||||
stats.delete_length = 0;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -790,7 +790,7 @@ int my_fprintf(FILE *stream, const char* format, ...)
|
|||
@param nr Error number
|
||||
*/
|
||||
|
||||
void my_strerror(char *buf, size_t len, int nr)
|
||||
const char* my_strerror(char *buf, size_t len, int nr)
|
||||
{
|
||||
char *msg= NULL;
|
||||
|
||||
|
|
@ -802,7 +802,7 @@ void my_strerror(char *buf, size_t len, int nr)
|
|||
"Internal error/check (Not system error)" :
|
||||
"Internal error < 0 (Not system error)"),
|
||||
len-1);
|
||||
return;
|
||||
return buf;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -843,4 +843,5 @@ void my_strerror(char *buf, size_t len, int nr)
|
|||
*/
|
||||
if (!buf[0])
|
||||
strmake(buf, "unknown error", len - 1);
|
||||
return buf;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue