OSDN Git Service

(inspired by a patch from Egor Duda)
authorcgf <cgf>
Sat, 31 Aug 2002 03:35:49 +0000 (03:35 +0000)
committercgf <cgf>
Sat, 31 Aug 2002 03:35:49 +0000 (03:35 +0000)
* select.cc (fhandler_tty_slave::ready_for_read): Remove.
* fhandler.h (fhandler_tty_slave::ready_for_read): Remove declaration.
* fhandler_tty.cc (fhandler_tty_slave::read): Don't do anything special with
vtime when vmin == 0.
* autoload.cc (GetConsoleWindow): Correct parameter count.

winsup/cygwin/ChangeLog
winsup/cygwin/autoload.cc
winsup/cygwin/fhandler.h
winsup/cygwin/fhandler_tty.cc
winsup/cygwin/select.cc

index 3877a85..980c083 100644 (file)
@@ -1,8 +1,21 @@
+2002-08-30  Christopher Faylor  <cgf@redhat.com>
+
+       (inspired by a patch from Egor Duda)
+       * select.cc (fhandler_tty_slave::ready_for_read): Remove.
+       * fhandler.h (fhandler_tty_slave::ready_for_read): Remove declaration.
+       * fhandler_tty.cc (fhandler_tty_slave::read): Don't do anything special
+       with vtime when vmin == 0.
+
+2002-07-25  Egor Duda  <deo@logos-m.ru>
+
+       * autoload.cc (GetConsoleWindow): Correct parameter count.
+
 2002-08-30  Christopher January  <chris@atomice.net>
            Christopher Faylor  <cgf@redhat.com>
 
        * tty.cc (tty_list::allocate_tty): Use GetConsoleWindow, if available.
        Call FindWindow in a loop.
+       * autoload.cc (GetConsoleWindow): Export
 
 2002-08-30  Christopher Faylor  <cgf@redhat.com>
 
index 0c0334f..7c3f47f 100644 (file)
@@ -494,7 +494,7 @@ LoadDLLfunc (CoCreateInstance, 20, ole32)
 LoadDLLfuncEx (CancelIo, 4, kernel32, 1)
 LoadDLLfuncEx (CreateHardLinkA, 12, kernel32, 1)
 LoadDLLfuncEx (CreateToolhelp32Snapshot, 8, kernel32, 1)
-LoadDLLfuncEx (GetConsoleWindow, 4, kernel32, 1)
+LoadDLLfuncEx (GetConsoleWindow, 0, kernel32, 1)
 LoadDLLfuncEx2 (IsDebuggerPresent, 0, kernel32, 1, 1)
 LoadDLLfuncEx (Process32First, 8, kernel32, 1)
 LoadDLLfuncEx (Process32Next, 8, kernel32, 1)
index a63c051..786c2ad 100644 (file)
@@ -888,8 +888,6 @@ class fhandler_tty_slave: public fhandler_tty_common
 
   __off64_t lseek (__off64_t, int) { return 0; }
   select_record *select_read (select_record *s);
-  int ready_for_read (int fd, DWORD howlong);
-
   int cygserver_attach_tty (HANDLE*, HANDLE*);
 };
 
index acc32f8..95aff5f 100644 (file)
@@ -412,6 +412,7 @@ process_ioctl (void *)
 fhandler_tty_slave::fhandler_tty_slave (int num)
   : fhandler_tty_common (FH_TTYS, num)
 {
+  set_r_no_interrupt (1);
 }
 
 fhandler_tty_slave::fhandler_tty_slave ()
@@ -666,12 +667,11 @@ fhandler_tty_slave::read (void *ptr, size_t len)
       if (vmin > INP_BUFFER_SIZE)
        vmin = INP_BUFFER_SIZE;
       vtime = get_ttyp ()->ti.c_cc[VTIME];
-      if (vmin < 0) vmin = 0;
-      if (vtime < 0) vtime = 0;
-      if (vmin == 0)
-       time_to_wait = INFINITE;
-      else
-       time_to_wait = (vtime == 0 ? INFINITE : 100 * vtime);
+      if (vmin < 0)
+       vmin = 0;
+      if (vtime < 0)
+       vtime = 0;
+      time_to_wait = vtime == 0 ? INFINITE : 100 * vtime;
     }
   else
     time_to_wait = INFINITE;
@@ -910,8 +910,8 @@ fhandler_tty_slave::ioctl (unsigned int cmd, void *arg)
 {
   termios_printf ("ioctl (%x)", cmd);
 
-  if (myself->pgid && get_ttyp ()->getpgid () != myself->pgid &&
-        myself->ctty == ttynum && (get_ttyp ()->ti.c_lflag & TOSTOP))
+  if (myself->pgid && get_ttyp ()->getpgid () != myself->pgid
+      && myself->ctty == ttynum && (get_ttyp ()->ti.c_lflag & TOSTOP))
     {
       /* background process */
       termios_printf ("bg ioctl pgid %d, tpgid %d, ctty %d",
index c3c4158..34fa6c8 100644 (file)
@@ -787,40 +787,6 @@ fhandler_tty_slave::select_read (select_record *s)
   return s;
 }
 
-int
-fhandler_tty_slave::ready_for_read (int fd, DWORD howlong)
-{
-  HANDLE w4[2];
-  if (cygheap->fdtab.not_open (fd))
-    {
-      set_sig_errno (EBADF);
-      return 0;
-    }
-  if (get_readahead_valid ())
-    {
-      select_printf ("readahead");
-      return 1;
-    }
-  w4[0] = signal_arrived;
-  w4[1] = input_available_event;
-  switch (WaitForMultipleObjects (2, w4, FALSE, howlong))
-    {
-    case WAIT_OBJECT_0:
-      set_sig_errno (EINTR);
-      return 0;
-    case WAIT_OBJECT_0 + 1:
-      return 1;
-    case WAIT_FAILED:
-      select_printf ("wait failed %E");
-      set_sig_errno (EINVAL); /* FIXME: correct errno? */
-      return 0;
-    default:
-      if (!howlong)
-       set_sig_errno (EAGAIN);
-      return 0;
-    }
-}
-
 select_record *
 fhandler_dev_null::select_read (select_record *s)
 {