Commit 46ae2104 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: my_strerror

parent 590d4737
......@@ -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;
}
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