diff options
author | Alexey Botchkov <holyfoot@mysql.com> | 2008-10-27 13:57:59 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@mysql.com> | 2008-10-27 13:57:59 +0400 |
commit | da1d159fbfca1bc5f38bd24da633fb7cf1686f58 (patch) | |
tree | aa7b899c121b6572fb65f716fb71cddc27f7136c /sql/mysql_priv.h | |
parent | e142ffdea126da683a01152158cd7e7443fc9f24 (diff) | |
download | mariadb-git-da1d159fbfca1bc5f38bd24da633fb7cf1686f58.tar.gz |
Bug#39289 libmysqld.a calls exit() upon error
Several functions (mostly in mysqld.cc) directly call
exit() function in case of errors, which is not a desired
behaviour expecially in the embedded-server library.
Fixed by making these functions return error sign instead
of exiting.
per-file comments:
include/my_getopt.h
Bug#39289 libmysqld.a calls exit() upon error
added 'error' retvalue for my_getopt_register_get_addr
libmysqld/lib_sql.cc
Bug#39289 libmysqld.a calls exit() upon error
unireg_clear() function implemented
mysys/default.c
Bug#39289 libmysqld.a calls exit() upon error
error returned instead of exit() call
mysys/mf_tempdir.c
Bug#39289 libmysqld.a calls exit() upon error
free_tmpdir() - fixed so it's not produce crash on uninitialized
tmpdir structure
mysys/my_getopt.c
Bug#39289 libmysqld.a calls exit() upon error
error returned instead of exit() call
sql/mysql_priv.h
Bug#39289 libmysqld.a calls exit() upon error
unireg_abort definition fixed for the embedded server
sql/mysqld.cc
Bug#39289 libmysqld.a calls exit() upon error
various functions fixed
error returned instead of exit() call
Diffstat (limited to 'sql/mysql_priv.h')
-rw-r--r-- | sql/mysql_priv.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index d11f2838e3a..192da33422e 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -2406,7 +2406,8 @@ extern "C" void unireg_abort(int exit_code) __attribute__((noreturn)); void kill_delayed_threads(void); bool check_stack_overrun(THD *thd, long margin, uchar *dummy); #else -#define unireg_abort(exit_code) DBUG_RETURN(exit_code) +extern "C" void unireg_clear(int exit_code); +#define unireg_abort(exit_code) do { unireg_clear(exit_code); DBUG_RETURN(exit_code); } while(0) inline void kill_delayed_threads(void) {} #define check_stack_overrun(A, B, C) 0 #endif |