]> git.eshelyaron.com Git - emacs.git/commitdiff
(XTflash): Make the timeout of select shorter, and call
authorGerd Moellmann <gerd@gnu.org>
Tue, 6 Mar 2001 19:50:42 +0000 (19:50 +0000)
committerGerd Moellmann <gerd@gnu.org>
Tue, 6 Mar 2001 19:50:42 +0000 (19:50 +0000)
select repeatedly until the desired time expires.

src/ChangeLog
src/xterm.c

index ce32656822a952f8228ff8495910acadf49fb96e..bb6859cf6a5b167fa1ada6e2be4bc505a4b9513e 100644 (file)
@@ -1,3 +1,8 @@
+2001-03-06  Kenichi Handa  <handa@etl.go.jp>
+
+       * xterm.c (XTflash): Make the timeout of select shorter, and call
+       select repeatedly until the desired time expires.
+
 2001-03-06  Gerd Moellmann  <gerd@gnu.org>
 
        * w32fns.c (Fx_create_frame): Clear Vwindow_list.
index fc09897de019753a34d0dfd3f53893a29d185b14..ae786d5058b2d25162343dc935624912f540c1fd 100644 (file)
@@ -5437,18 +5437,23 @@ XTflash (f)
        wakeup.tv_sec += (wakeup.tv_usec / 1000000);
        wakeup.tv_usec %= 1000000;
 
-       /* Keep waiting until past the time wakeup.  */
-       while (1)
+       /* Keep waiting until past the time wakeup or any input gets
+          available.  */
+       while (! detect_input_pending ())
          {
+           struct timeval current;
            struct timeval timeout;
 
-           EMACS_GET_TIME (timeout);
+           EMACS_GET_TIME (current);
 
-           /* In effect, timeout = wakeup - timeout.
-              Break if result would be negative.  */
-           if (timeval_subtract (&timeout, wakeup, timeout))
+           /* Break if result would be negative.  */
+           if (timeval_subtract (&current, wakeup, current))
              break;
 
+           /* How long `select' should wait.  */
+           timeout.tv_sec = 0;
+           timeout.tv_usec = 10000;
+
            /* Try to wait that long--but we might wake up sooner.  */
            select (0, NULL, NULL, NULL, &timeout);
          }