Commit a1b8e4dc authored by Davi Arnaut's avatar Davi Arnaut

Backport: remove dead code.

Reorganize function to reflect that it does not actually uses curses
and that there is no curses variant.
parent 11648411
......@@ -41,8 +41,6 @@ extern int NEAR my_errno; /* Last error in mysys */
#include <malloc.h> /*for alloca*/
#endif
#define MYSYS_PROGRAM_USES_CURSES() { error_handler_hook = my_message_curses; mysys_uses_curses=1; }
#define MYSYS_PROGRAM_DONT_USE_CURSES() { error_handler_hook = my_message_no_curses; mysys_uses_curses=0;}
#define MY_INIT(name); { my_progname= name; my_init(); }
/**
......@@ -272,7 +270,7 @@ extern int NEAR my_umask_dir,
NEAR my_recived_signals, /* Signals we have got */
NEAR my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */
NEAR my_dont_interrupt; /* call remember_intr when set */
extern my_bool NEAR mysys_uses_curses, my_use_symdir;
extern my_bool NEAR my_use_symdir;
extern size_t sf_malloc_cur_memory, sf_malloc_max_memory;
extern ulong my_default_record_cache_size;
......@@ -669,7 +667,6 @@ extern int nt_share_delete(const char *name,myf MyFlags);
#ifdef _WIN32
/* Windows-only functions (CRT equivalents)*/
extern File my_sopen(const char *path, int oflag, int shflag, int pmode);
extern HANDLE my_get_osfhandle(File fd);
extern void my_osmaperr(unsigned long last_error);
#endif
......@@ -698,8 +695,7 @@ extern int my_error_register(const char** (*get_errmsgs) (),
int first, int last);
extern const char **my_error_unregister(int first, int last);
extern void my_message(uint my_err, const char *str,myf MyFlags);
extern void my_message_no_curses(uint my_err, const char *str,myf MyFlags);
extern void my_message_curses(uint my_err, const char *str,myf MyFlags);
extern void my_message_stderr(uint my_err, const char *str, myf MyFlags);
extern my_bool my_basic_init(void);
extern my_bool my_init(void);
extern void my_end(int infoflag);
......
......@@ -27,7 +27,7 @@ SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c default.c default_
my_clock.c my_compress.c my_copy.c my_crc32.c my_create.c my_delete.c
my_div.c my_error.c my_file.c my_fopen.c my_fstream.c my_gethostbyname.c
my_gethwaddr.c my_getopt.c my_getsystime.c my_getwd.c my_handler.c my_init.c
my_lib.c my_lock.c my_lockmem.c my_malloc.c my_messnc.c
my_lib.c my_lock.c my_lockmem.c my_malloc.c my_mess.c
my_mkdir.c my_mmap.c my_net.c my_once.c my_open.c my_pread.c my_pthread.c
my_quick.c my_read.c my_realloc.c my_redel.c my_rename.c my_seek.c my_sleep.c
my_static.c my_symlink.c my_symlink2.c my_sync.c my_thr_init.c
......
......@@ -34,7 +34,7 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \
my_vle.c my_atomic.c lf_hash.c \
lf_dynarray.c lf_alloc-pin.c \
my_fopen.c my_fstream.c my_getsystime.c \
my_error.c errors.c my_div.c my_messnc.c \
my_error.c errors.c my_div.c my_mess.c \
mf_format.c mf_same.c mf_dirname.c mf_fn_ext.c \
my_symlink.c my_symlink2.c \
mf_pack.c mf_unixpath.c mf_arr_appstr.c \
......
......@@ -204,7 +204,7 @@ void my_end(int infoflag)
char ebuff[512];
my_snprintf(ebuff, sizeof(ebuff), EE(EE_OPEN_WARNING),
my_file_opened, my_stream_opened);
my_message_no_curses(EE_OPEN_WARNING, ebuff, ME_BELL);
my_message_stderr(EE_OPEN_WARNING, ebuff, ME_BELL);
DBUG_PRINT("error", ("%s", ebuff));
my_print_open_files();
}
......
......@@ -15,10 +15,10 @@
#include "mysys_priv.h"
void my_message_no_curses(uint error __attribute__((unused)),
void my_message_stderr(uint error __attribute__((unused)),
const char *str, myf MyFlags)
{
DBUG_ENTER("my_message_no_curses");
DBUG_ENTER("my_message_stderr");
DBUG_PRINT("enter",("message: %s",str));
(void) fflush(stdout);
if (MyFlags & ME_BELL)
......
......@@ -87,10 +87,10 @@ ulong my_time_to_wait_for_lock=2; /* In seconds */
char * NEAR globerrs[GLOBERRS]; /* my_error_messages is here */
#endif
void (*my_abort_hook)(int) = (void(*)(int)) exit;
void (*error_handler_hook)(uint error,const char *str,myf MyFlags)=
my_message_no_curses;
void (*fatal_error_handler_hook)(uint error,const char *str,myf MyFlags)=
my_message_no_curses;
void (*error_handler_hook)(uint error, const char *str, myf MyFlags)=
my_message_stderr;
void (*fatal_error_handler_hook)(uint error, const char *str, myf MyFlags)=
my_message_stderr;
static const char *proc_info_dummy(void *a __attribute__((unused)),
const char *b __attribute__((unused)),
......@@ -123,7 +123,6 @@ my_bool NEAR my_disable_locking=0;
my_bool NEAR my_disable_async_io=0;
my_bool NEAR my_disable_flush_key_blocks=0;
my_bool NEAR my_disable_symlinks=0;
my_bool NEAR mysys_uses_curses=0;
/*
Note that PSI_hook and PSI_server are unconditionally
......
......@@ -33,7 +33,7 @@ void unireg_init(ulong options)
{
DBUG_ENTER("unireg_init");
MYSYS_PROGRAM_DONT_USE_CURSES();
error_handler_hook = my_message_stderr;
abort_loop=0;
my_disable_async_io=1; /* aioread is only in shared library */
......
......@@ -3601,7 +3601,6 @@ static int init_common_variables()
if (item_create_init())
return 1;
item_init();
mysys_uses_curses=0;
#ifdef USE_REGEX
my_regex_init(&my_charset_latin1);
#endif
......
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