Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-11-04 04:10:38 +0300
committerChristopher Faylor <me@cgf.cx>2002-11-04 04:10:38 +0300
commit2601ab5778798ab6306bb0a197b24fb8753e992f (patch)
treeae8067ad33328abb6f93ae490dbab7a431211cf4
parent3593c18730f0208d0e1f110b2e0eca4be11514e7 (diff)
* fhandler_tty.cc (fhandler_tty_slave::ioctl): Do nothing if the new window
size is equal to the old one. Send SIGWINCH if slave connected to a pseudo tty. (fhandler_pty_master::ioctl): Do nothing if the new window size is equal to the old one.
-rw-r--r--winsup/cygwin/ChangeLog8
-rw-r--r--winsup/cygwin/fhandler_tty.cc33
2 files changed, 32 insertions, 9 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index cfe2ae666..59d7bd61e 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,11 @@
+2002-11-03 Sergey Okhapkin <sos@prospect.com.ru>
+
+ * fhandler_tty.cc (fhandler_tty_slave::ioctl): Do nothing if the new
+ window size is equal to the old one. Send SIGWINCH if slave connected
+ to a pseudo tty.
+ (fhandler_pty_master::ioctl): Do nothing if the new window size is
+ equal to the old one.
+
2002-10-31 Pierre Humblet <pierre.humblet@ieee.org>
* fhandler.cc (fhandler_base::open): Verify pc isn't NULL.
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 8455f75b3..ed1092776 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -949,18 +949,29 @@ fhandler_tty_slave::ioctl (unsigned int cmd, void *arg)
get_ttyp ()->arg.winsize = get_ttyp ()->winsize;
if (ioctl_request_event)
SetEvent (ioctl_request_event);
- * (struct winsize *) arg = get_ttyp ()->arg.winsize;
+ *(struct winsize *) arg = get_ttyp ()->arg.winsize;
if (ioctl_done_event)
WaitForSingleObject (ioctl_done_event, INFINITE);
get_ttyp ()->winsize = get_ttyp ()->arg.winsize;
break;
case TIOCSWINSZ:
- get_ttyp ()->ioctl_retval = -1;
- get_ttyp ()->arg.winsize = * (struct winsize *) arg;
- if (ioctl_request_event)
- SetEvent (ioctl_request_event);
- if (ioctl_done_event)
- WaitForSingleObject (ioctl_done_event, INFINITE);
+ if (get_ttyp ()->winsize.ws_row != ((struct winsize *) arg)->ws_row
+ || get_ttyp ()->winsize.ws_col != ((struct winsize *) arg)->ws_col)
+ {
+ get_ttyp ()->arg.winsize = *(struct winsize *) arg;
+ if (ioctl_request_event)
+ {
+ get_ttyp ()->ioctl_retval = -1;
+ SetEvent (ioctl_request_event);
+ }
+ else
+ {
+ get_ttyp ()->winsize = *(struct winsize *) arg;
+ kill (-get_ttyp ()->getpgid (), SIGWINCH);
+ }
+ if (ioctl_done_event)
+ WaitForSingleObject (ioctl_done_event, INFINITE);
+ }
break;
}
@@ -1103,8 +1114,12 @@ fhandler_pty_master::ioctl (unsigned int cmd, void *arg)
* (struct winsize *) arg = get_ttyp ()->winsize;
break;
case TIOCSWINSZ:
- get_ttyp ()->winsize = * (struct winsize *) arg;
- kill (-get_ttyp ()->getpgid (), SIGWINCH);
+ if (get_ttyp ()->winsize.ws_row != ((struct winsize *) arg)->ws_row
+ || get_ttyp ()->winsize.ws_col != ((struct winsize *) arg)->ws_col)
+ {
+ get_ttyp ()->winsize = * (struct winsize *) arg;
+ kill (-get_ttyp ()->getpgid (), SIGWINCH);
+ }
break;
case FIONBIO:
set_nonblocking (*(int *) arg);