summaryrefslogtreecommitdiffstats
path: root/client-msg.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2007-11-27 20:03:08 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2007-11-27 20:03:08 +0000
commit7034ba236f4cbb94753f23747e363644a932221e (patch)
tree75781655cff60e52599795e80a3f2a679aca002c /client-msg.c
parent5cd1d459c5351774dbcda51911278d781384bf0f (diff)
Same exit process applied to detach.
Diffstat (limited to 'client-msg.c')
-rw-r--r--client-msg.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/client-msg.c b/client-msg.c
index b90488a1..878bbcd0 100644
--- a/client-msg.c
+++ b/client-msg.c
@@ -1,4 +1,4 @@
-/* $Id: client-msg.c,v 1.12 2007-11-27 20:01:30 nicm Exp $ */
+/* $Id: client-msg.c,v 1.13 2007-11-27 20:03:08 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -84,37 +84,37 @@ client_msg_fn_error(struct hdr *hdr, struct client_ctx *cctx, char **error)
}
int
-client_msg_fn_exit(
+client_msg_fn_detach(
struct hdr *hdr, unused struct client_ctx *cctx, unused char **error)
{
if (hdr->size != 0)
- fatalx("bad MSG_EXIT size");
+ fatalx("bad MSG_DETACH size");
client_write_server(cctx, MSG_EXITING, NULL, 0);
-
+ cctx->flags |= CCTX_DETACH;
+
return (0);
}
int
-client_msg_fn_exited(
+client_msg_fn_exit(
struct hdr *hdr, unused struct client_ctx *cctx, unused char **error)
{
if (hdr->size != 0)
- fatalx("bad MSG_EXITED size");
+ fatalx("bad MSG_EXIT size");
+ client_write_server(cctx, MSG_EXITING, NULL, 0);
cctx->flags |= CCTX_EXIT;
- return (-1);
+ return (0);
}
int
-client_msg_fn_detach(
+client_msg_fn_exited(
struct hdr *hdr, unused struct client_ctx *cctx, unused char **error)
{
if (hdr->size != 0)
- fatalx("bad MSG_DETACH size");
-
- cctx->flags |= CCTX_DETACH;
+ fatalx("bad MSG_EXITED size");
return (-1);
}