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); ...@@ -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 FILE *my_freopen(const char *path, const char *mode, FILE *stream);
extern int my_fclose(FILE *fd,myf MyFlags); extern int my_fclose(FILE *fd,myf MyFlags);
extern int my_vfprintf(FILE *stream, const char* format, va_list args); 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 int my_fprintf(FILE *stream, const char* format, ...);
extern File my_fileno(FILE *fd); extern File my_fileno(FILE *fd);
extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags); extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags);
......
...@@ -2619,11 +2619,10 @@ innobase_mysql_tmpfile( ...@@ -2619,11 +2619,10 @@ innobase_mysql_tmpfile(
char errbuf[MYSYS_STRERROR_SIZE]; char errbuf[MYSYS_STRERROR_SIZE];
DBUG_PRINT("error",("Got error %d on dup",fd2)); DBUG_PRINT("error",("Got error %d on dup",fd2));
set_my_errno(errno); set_my_errno(errno);
my_strerror(errbuf, sizeof(errbuf), my_errno);
my_error(EE_OUT_OF_FILERESOURCES, my_error(EE_OUT_OF_FILERESOURCES,
MYF(0), MYF(0),
"ib*", my_errno, "ib*", errno,
errbuf); my_strerror(errbuf, sizeof(errbuf), errno));
} }
my_close(fd, MYF(MY_WME)); my_close(fd, MYF(MY_WME));
} }
...@@ -16092,8 +16091,7 @@ ha_innobase::info_low( ...@@ -16092,8 +16091,7 @@ ha_innobase::info_low(
char errbuf[MYSYS_STRERROR_SIZE]; char errbuf[MYSYS_STRERROR_SIZE];
thd = ha_thd(); thd = ha_thd();
my_strerror(errbuf, sizeof(errbuf),
errno);
push_warning_printf( push_warning_printf(
thd, thd,
Sql_condition::WARN_LEVEL_WARN, Sql_condition::WARN_LEVEL_WARN,
...@@ -16105,8 +16103,8 @@ ha_innobase::info_low( ...@@ -16105,8 +16103,8 @@ ha_innobase::info_low(
" the free space to zero." " the free space to zero."
" (errno: %d - %s)", " (errno: %d - %s)",
ib_table->name.m_name, errno, ib_table->name.m_name, errno,
errbuf); my_strerror(errbuf, sizeof(errbuf),
errno));
stats.delete_length = 0; stats.delete_length = 0;
} else { } else {
......
...@@ -790,7 +790,7 @@ int my_fprintf(FILE *stream, const char* format, ...) ...@@ -790,7 +790,7 @@ int my_fprintf(FILE *stream, const char* format, ...)
@param nr Error number @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; char *msg= NULL;
...@@ -802,7 +802,7 @@ void my_strerror(char *buf, size_t len, int nr) ...@@ -802,7 +802,7 @@ void my_strerror(char *buf, size_t len, int nr)
"Internal error/check (Not system error)" : "Internal error/check (Not system error)" :
"Internal error < 0 (Not system error)"), "Internal error < 0 (Not system error)"),
len-1); len-1);
return; return buf;
} }
/* /*
...@@ -843,4 +843,5 @@ void my_strerror(char *buf, size_t len, int nr) ...@@ -843,4 +843,5 @@ void my_strerror(char *buf, size_t len, int nr)
*/ */
if (!buf[0]) if (!buf[0])
strmake(buf, "unknown error", len - 1); 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