From d10def5b0b5a4d000b1a34efd32cc4a2613f66c7 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Thu, 12 Oct 2017 11:56:06 +0100 Subject: [PATCH] Check missed during merge. --- server-client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server-client.c b/server-client.c index 7c4af0d6..37b648c8 100644 --- a/server-client.c +++ b/server-client.c @@ -1067,7 +1067,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) #ifdef __sun if (errno != EINVAL && errno != ENXIO) #endif @@ -1096,7 +1096,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) #ifdef __sun /* * Some versions of Solaris apparently can return an error when