summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-09-23 14:44:02 +0000
committerTiago Cunha <tcunha@gmx.com>2009-09-23 14:44:02 +0000
commit2acf349d4e855eeb8b5d8303cc89aec016210e30 (patch)
treee508d208378741436f6b487cc91f89087522f11a /client.c
parentacedc2dcf2673cf199ba1ba08705dc8fd270c0c7 (diff)
Sync OpenBSD patchset 346:
Trim some code by moving the ioctl(TIOCGWINSZ) after SIGWINCH from the client into the server. This is another (the second of four) protocol version changes coming this morning, so again the server should be killed before upgrading.
Diffstat (limited to 'client.c')
-rw-r--r--client.c27
1 files changed, 5 insertions, 22 deletions
diff --git a/client.c b/client.c
index ffaded72..aebf7784 100644
--- a/client.c
+++ b/client.c
@@ -1,4 +1,4 @@
-/* $Id: client.c,v 1.72 2009-09-23 14:39:30 tcunha Exp $ */
+/* $Id: client.c,v 1.73 2009-09-23 14:44:02 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -34,7 +34,6 @@
#include "tmux.h"
void client_send_environ(struct client_ctx *);
-void client_handle_winch(struct client_ctx *);
int
client_init(char *path, struct client_ctx *cctx, int cmdflags, int flags)
@@ -104,8 +103,6 @@ server_started:
if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) == -1)
fatal("ioctl(TIOCGWINSZ)");
data.flags = flags;
- data.sx = ws.ws_col;
- data.sy = ws.ws_row;
if (getcwd(data.cwd, sizeof data.cwd) == NULL)
*data.cwd = '\0';
@@ -173,8 +170,10 @@ client_main(struct client_ctx *cctx)
waitpid(WAIT_ANY, NULL, WNOHANG);
sigchld = 0;
}
- if (sigwinch)
- client_handle_winch(cctx);
+ if (sigwinch) {
+ client_write_server(cctx, MSG_RESIZE, NULL, 0);
+ sigwinch = 0;
+ }
if (sigcont) {
siginit();
client_write_server(cctx, MSG_WAKEUP, NULL, 0);
@@ -242,22 +241,6 @@ out:
}
}
-void
-client_handle_winch(struct client_ctx *cctx)
-{
- struct msg_resize_data data;
- struct winsize ws;
-
- if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) == -1)
- fatal("ioctl failed");
-
- data.sx = ws.ws_col;
- data.sy = ws.ws_row;
- client_write_server(cctx, MSG_RESIZE, &data, sizeof data);
-
- sigwinch = 0;
-}
-
int
client_msg_dispatch(struct client_ctx *cctx)
{