#include <signal.h>
#define CMD_BUFLEN 1024
+static int WARN_STOP = 0;
#ifdef WIN32
#define strdup(src) _strdup(src)
static void handle_SIGINT(int sig)
{
if (sig);
+
+ WARN_STOP = 1;
+
+ signal(SIGINT, handle_SIGINT);
+#ifdef SIGTSTP
+ signal(SIGTSTP, handle_SIGINT);
+#endif
return;
}
while(thread_running && handle->connected) {
esl_status_t status = esl_recv_event_timed(handle, 10, 1, NULL);
+
+ if (WARN_STOP) {
+ printf("Type control-D or /exit or /quit or /bye to exit.\n\n");
+ WARN_STOP = 0;
+ }
+
if (status == ESL_FAIL) {
esl_log(ESL_LOG_WARNING, "Disconnected.\n");
running = -1; thread_running = 0;
}
signal(SIGINT, handle_SIGINT);
+#ifdef SIGTSTP
+ signal(SIGTSTP, handle_SIGINT);
+#endif
#ifdef SIGQUIT
signal(SIGQUIT, handle_SIGQUIT);
#endif