aboutsummaryrefslogtreecommitdiffstats
path: root/src/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon.c')
-rw-r--r--src/daemon.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/daemon.c b/src/daemon.c
index c354d67..b3cd11a 100644
--- a/src/daemon.c
+++ b/src/daemon.c
@@ -50,7 +50,7 @@ void runes_socket_delete(RunesDaemon *daemon)
static int runes_daemon_handle_request(void *t)
{
RunesDaemon *daemon = (RunesDaemon *)t;
- int client_sock, type;
+ int client_sock, type, ret = 1;
char *buf;
size_t len;
@@ -61,6 +61,10 @@ static int runes_daemon_handle_request(void *t)
case RUNES_PROTOCOL_NEW_TERM:
runes_daemon_handle_new_term_message(daemon, buf, len);
break;
+ case RUNES_PROTOCOL_KILL_DAEMON:
+ ret = 0;
+ runes_loop_stop(daemon->loop);
+ break;
default:
runes_warn("unknown packet type: %d", type);
break;
@@ -74,7 +78,7 @@ static int runes_daemon_handle_request(void *t)
runes_socket_client_close(client_sock);
- return 1;
+ return ret;
}
static void runes_daemon_handle_new_term_message(