]> git.eshelyaron.com Git - emacs.git/commitdiff
Add missing timeout value in ns_select
authorAlan Third <alan@idiocy.org>
Wed, 8 Mar 2017 00:40:05 +0000 (00:40 +0000)
committerAlan Third <alan@idiocy.org>
Wed, 8 Mar 2017 00:50:16 +0000 (00:50 +0000)
* src/nsterm.m (ns_select): Set timeout to distant future when relying
on fd_handler's timeout.

src/nsterm.m

index ebe29e426191b60320ac580a7933868d457ca43b..f985786e1984318317e769477eb7182a8c87d23d 100644 (file)
@@ -4168,10 +4168,16 @@ ns_select (int nfds, fd_set *readfds, fd_set *writefds,
       /* Inform fd_handler that select should be called */
       c = 'g';
       emacs_write_sig (selfds[1], &c, 1);
+
+      /* We rely on fd_handler timing out to cause
+         nextEventMatchingMask below to return, so set it's timeout to
+         an unreasonably long time. */
+      timeout_date = [NSDate distantFuture];
     }
   else if (nr == 0 && timeout)
     {
-      /* No file descriptor, just a timeout, no need to wake fd_handler  */
+      /* No file descriptor, just a timeout, no need to wake
+         fd_handler. Set nextEventMatchingMask timeout. */
       double time = timespectod (*timeout);
       timeout_date = [NSDate dateWithTimeIntervalSinceNow: time];
     }