Commit ce1d3a13 authored by Vysheng's avatar Vysheng

Fixed readline_disable mode

parent df06d085
...@@ -970,6 +970,7 @@ extern char *lua_file; ...@@ -970,6 +970,7 @@ extern char *lua_file;
extern struct event *term_ev; extern struct event *term_ev;
void do_clear (int arg_num, struct arg args[], struct in_ev *ev) { void do_clear (int arg_num, struct arg args[], struct in_ev *ev) {
logprintf ("Do_clear\n");
tgl_free_all (); tgl_free_all ();
free (default_username); free (default_username);
free (config_filename); free (config_filename);
......
...@@ -141,6 +141,7 @@ static void stdin_read_callback_all (int arg, short what, struct event *self) { ...@@ -141,6 +141,7 @@ static void stdin_read_callback_all (int arg, short what, struct event *self) {
break; break;
} }
} }
break;
} }
} }
} }
......
...@@ -34,6 +34,14 @@ ...@@ -34,6 +34,14 @@
#else #else
#include <editline/readline.h> #include <editline/readline.h>
#endif #endif
#ifdef EVENT_V2
#include <event2/event.h>
#include <event2/bufferevent.h>
#include <event2/buffer.h>
#else
#include <event.h>
#include "event-old.h"
#endif
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/socket.h> #include <sys/socket.h>
...@@ -676,6 +684,9 @@ void sig_term_handler (int signum __attribute__ ((unused))) { ...@@ -676,6 +684,9 @@ void sig_term_handler (int signum __attribute__ ((unused))) {
if (write (1, "SIGTERM/SIGINT received\n", 25) < 0) { if (write (1, "SIGTERM/SIGINT received\n", 25) < 0) {
// Sad thing // Sad thing
} }
if (tgl_state.ev_base) {
event_base_loopbreak(tgl_state.ev_base);
}
sigterm_cnt ++; sigterm_cnt ++;
} }
......
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