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 @@ -83,6 +83,19 @@ client_msg_fn_error(struct hdr *hdr, struct client_ctx *cctx, char **error) return (-1); } +int +client_msg_fn_detach( + struct hdr *hdr, unused struct client_ctx *cctx, unused char **error) +{ + if (hdr->size != 0) + fatalx("bad MSG_DETACH size"); + + client_write_server(cctx, MSG_EXITING, NULL, 0); + cctx->flags |= CCTX_DETACH; + + return (0); +} + int client_msg_fn_exit( struct hdr *hdr, unused struct client_ctx *cctx, unused char **error) @@ -91,6 +104,7 @@ client_msg_fn_exit( fatalx("bad MSG_EXIT size"); client_write_server(cctx, MSG_EXITING, NULL, 0); + cctx->flags |= CCTX_EXIT; return (0); } @@ -102,19 +116,5 @@ client_msg_fn_exited( if (hdr->size != 0) fatalx("bad MSG_EXITED size"); - cctx->flags |= CCTX_EXIT; - - return (-1); -} - -int -client_msg_fn_detach( - struct hdr *hdr, unused struct client_ctx *cctx, unused char **error) -{ - if (hdr->size != 0) - fatalx("bad MSG_DETACH size"); - - cctx->flags |= CCTX_DETACH; - return (-1); } diff --git a/tmux.h b/tmux.h index 2382a630..e45c3e41 100644 --- a/tmux.h +++ b/tmux.h @@ -1,4 +1,4 @@ -/* $Id: tmux.h,v 1.103 2007-11-27 20:01:30 nicm Exp $ */ +/* $Id: tmux.h,v 1.104 2007-11-27 20:03:08 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -291,9 +291,9 @@ enum hdrtype { MSG_EXIT, MSG_EXITING, MSG_EXITED, + MSG_DETACH, MSG_IDENTIFY, MSG_READY, - MSG_DETACH, MSG_RESIZE, };