summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-07-22 12:42:57 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-07-22 12:42:57 +0000
commit94e2339842b813b608fa7726f67b985eb8592712 (patch)
tree6cde54d4f91a6cc01f375a685c8b9be28541b35b
parent5263b3f61ebc9e3d865af5dcc8b69ab38ac55e07 (diff)
OpenSolaris ioctl(TIOCSWINSZ) appears to be broken and can return EINVAL here
despite sx, sy and fd being fine (an fcntl on the fd succeeds). No problems on other platforms so ignore the error under #ifdef __sun__.
-rw-r--r--window.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/window.c b/window.c
index 2f8b7d40..ab48a6ea 100644
--- a/window.c
+++ b/window.c
@@ -1,4 +1,4 @@
-/* $Id: window.c,v 1.95 2009-07-20 15:42:05 tcunha Exp $ */
+/* $Id: window.c,v 1.96 2009-07-22 12:42:57 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -549,6 +549,15 @@ window_pane_resize(struct window_pane *wp, u_int sx, u_int sy)
wp->mode->resize(wp, sx, sy);
if (wp->fd != -1 && ioctl(wp->fd, TIOCSWINSZ, &ws) == -1)
+#ifdef __sun__
+ /*
+ * Some versions of Solaris apparently can return an error when
+ * resizing; don't know why this happens, can't reproduce on
+ * other platforms and ignoring it doesn't seem to cause any
+ * issues.
+ */
+ if (errno != EINVAL)
+#endif
fatal("ioctl failed");
return (0);
}