diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-05-22 10:56:49 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-05-22 10:56:49 +0000 |
commit | 1a47989e1c6a692ac3c72e02286e5f1fcafc90da (patch) | |
tree | 423e496e997dcda7cfe689b2f3479a11e9de7f3f /usr.bin | |
parent | 2cfffe2cb66f4c526bcd67581871c672f4882be6 (diff) |
Add a helper function to send ready message.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/cmd-attach-session.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-new-session.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/server-fn.c | 8 | ||||
-rw-r--r-- | usr.bin/tmux/tmux.h | 3 |
4 files changed, 13 insertions, 6 deletions
diff --git a/usr.bin/tmux/cmd-attach-session.c b/usr.bin/tmux/cmd-attach-session.c index b5576890ec2..759f4df4e9b 100644 --- a/usr.bin/tmux/cmd-attach-session.c +++ b/usr.bin/tmux/cmd-attach-session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-attach-session.c,v 1.19 2012/05/06 07:38:17 nicm Exp $ */ +/* $OpenBSD: cmd-attach-session.c,v 1.20 2012/05/22 10:56:48 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -94,7 +94,7 @@ cmd_attach_session_exec(struct cmd *self, struct cmd_ctx *ctx) ctx->cmdclient->session = s; notify_attached_session_changed(ctx->cmdclient); session_update_activity(s); - server_write_client(ctx->cmdclient, MSG_READY, NULL, 0); + server_write_ready(ctx->cmdclient); update = options_get_string(&s->options, "update-environment"); environ_update(update, &ctx->cmdclient->environ, &s->environ); diff --git a/usr.bin/tmux/cmd-new-session.c b/usr.bin/tmux/cmd-new-session.c index 5ebc4e3e5bd..b461eddef15 100644 --- a/usr.bin/tmux/cmd-new-session.c +++ b/usr.bin/tmux/cmd-new-session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-new-session.c,v 1.42 2012/05/06 07:38:17 nicm Exp $ */ +/* $OpenBSD: cmd-new-session.c,v 1.43 2012/05/22 10:56:48 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -231,7 +231,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx) */ if (!detached) { if (ctx->cmdclient != NULL) { - server_write_client(ctx->cmdclient, MSG_READY, NULL, 0); + server_write_ready(ctx->cmdclient); old_s = ctx->cmdclient->session; if (old_s != NULL) diff --git a/usr.bin/tmux/server-fn.c b/usr.bin/tmux/server-fn.c index 502172b45b6..7fb995b4d03 100644 --- a/usr.bin/tmux/server-fn.c +++ b/usr.bin/tmux/server-fn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-fn.c,v 1.57 2012/05/21 18:27:42 nicm Exp $ */ +/* $OpenBSD: server-fn.c,v 1.58 2012/05/22 10:56:48 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -46,6 +46,12 @@ server_fill_environ(struct session *s, struct environ *env) environ_set(env, "TMUX", var); } +void +server_write_ready(struct client *c) +{ + server_write_client(c, MSG_READY, NULL, 0); +} + int server_write_client( struct client *c, enum msgtype type, const void *buf, size_t len) diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index 98580934089..a5fa0233f72 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.333 2012/05/22 09:36:12 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.334 2012/05/22 10:56:48 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -1743,6 +1743,7 @@ void server_window_loop(void); /* server-fn.c */ void server_fill_environ(struct session *, struct environ *); +void server_write_ready(struct client *); int server_write_client( struct client *, enum msgtype, const void *, size_t); void server_write_session( |