myadm

Simple MySQL client for the terminal
git clone git://git.bitsmanent.org/myadm
Log | Files | Refs | README | LICENSE

commit 36981e5671163aaaf7b9c9321d24e942df68a9fe
parent 40116c8499e5d11864520a068b13a71cc4b7d9a7
Author: Claudio Alessi <smoppy@gmail.com>
Date:   Thu, 14 Apr 2016 23:02:22 +0200

Remove all signals code.

We used to intercept SIGINT to show a quit message. After the introduction of
raw() we don't receive signals anymore so that's useless (and non-working)
code.

Diffstat:
Mconfig.def.h | 1+
Mmyadm.c | 14--------------
2 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -22,6 +22,7 @@ static Key keys[] = { { "databases", ' ', viewdb, {0} }, { "tables", '\n', viewtable, {0} }, { "tables", ' ', viewtable, {0} }, + { NULL, CTRL('c'), quit, {.i = 1} }, { NULL, 'Q', quit, {.i = 1} }, { NULL, 'q', viewprev, {0} }, { NULL, 'k', itemsel, {.i = -1} }, diff --git a/myadm.c b/myadm.c @@ -15,7 +15,6 @@ #include <stdarg.h> #include <string.h> #include <stdlib.h> -#include <signal.h> #include <mysql.h> #include <stfl.h> @@ -104,7 +103,6 @@ void reload(const Arg *arg); void run(void); void setview(const char *name, void (*func)(void)); void setup(void); -void sigint_handler(int unused); int stripesc(char *src, char *dst, int len); void ui_end(void); struct stfl_form *ui_getform(wchar_t *code); @@ -528,27 +526,15 @@ setview(const char *name, void (*func)(void)) { void setup(void) { - struct sigaction sa; - setlocale(LC_CTYPE, ""); mysql = mysql_init(NULL); if(mysql_real_connect(mysql, dbhost, dbuser, dbpass, NULL, 0, NULL, 0) == NULL) die("Cannot connect to the database.\n"); fldseplen = strlen(FLDSEP); - sa.sa_flags = 0; - sigemptyset(&sa.sa_mask); - sa.sa_handler = sigint_handler; - sigaction(SIGINT, &sa, NULL); ui_init(); setview("databases", viewdblist_show); } -void -sigint_handler(int unused) { - Arg arg = {.i = 1}; - quit(&arg); -} - int stripesc(char *dst, char *src, int len) { int i, n;