summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2017-09-06 07:12:42 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2017-09-06 07:12:42 +0000
commita44e0f8a8f6e69ad58b6adba3e6fc84253cd4809 (patch)
tree92934e7e865b4c825693dae2945f61592abea168 /usr.bin
parent15af96ee2b11304c5f4249a076dc30040940aa58 (diff)
Do not attempt to use TIOCSWINSZ on a -1 file descriptor (possible if
the pane has already died).
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/server-client.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c
index a73f5bf3ceb..6f4b864ab01 100644
--- a/usr.bin/tmux/server-client.c
+++ b/usr.bin/tmux/server-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-client.c,v 1.243 2017/08/30 10:33:57 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.244 2017/09/06 07:12:41 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1069,7 +1069,7 @@ server_client_resize_force(struct window_pane *wp)
memset(&ws, 0, sizeof ws);
ws.ws_col = wp->sx;
ws.ws_row = wp->sy - 1;
- if (ioctl(wp->fd, TIOCSWINSZ, &ws) == -1)
+ if (wp->fd != -1 && ioctl(wp->fd, TIOCSWINSZ, &ws) == -1)
fatal("ioctl failed");
log_debug("%s: %%%u forcing resize", __func__, wp->id);
@@ -1095,7 +1095,7 @@ server_client_resize_event(__unused int fd, __unused short events, void *data)
memset(&ws, 0, sizeof ws);
ws.ws_col = wp->sx;
ws.ws_row = wp->sy;
- if (ioctl(wp->fd, TIOCSWINSZ, &ws) == -1)
+ if (wp->fd != -1 && ioctl(wp->fd, TIOCSWINSZ, &ws) == -1)
fatal("ioctl failed");
log_debug("%s: %%%u resize to %u,%u", __func__, wp->id, wp->sx, wp->sy);