]> git.eshelyaron.com Git - emacs.git/commitdiff
Fixed OSX sys_read to not call select if IO is non-blocking
authorSteven Tamm <steventamm@mac.com>
Tue, 10 Dec 2002 16:48:04 +0000 (16:48 +0000)
committerSteven Tamm <steventamm@mac.com>
Tue, 10 Dec 2002 16:48:04 +0000 (16:48 +0000)
src/ChangeLog
src/mac.c

index 650df8494e7197f9f516cf65d0184cf7c1aa3e24..b8318c41949d304b4e83f9435399219e2d5a7a68 100644 (file)
@@ -1,3 +1,8 @@
+2002-12-10  Steven Tamm  <steventamm@mac.com>
+
+       * mac.c (sys_read): Fixed sys_read to not call select if IO is
+       non-blocking
+
 2002-12-10  Juanma Barranquero  <lektu@terra.es>
 
        * editfns.c (Fformat): Use alloca, not _alloca.
index 439f900db5b4694b88765e6f3aee83566679f2bf..bf1915cbacd4be3c7c8aba7e0998e56359f1e372 100644 (file)
--- a/src/mac.c
+++ b/src/mac.c
@@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA.  */
 #include <pwd.h>
 #include <sys/param.h>
 #include <stdlib.h>
+#include <fcntl.h>
 #if __MWERKS__
 #include <unistd.h>
 #endif
@@ -2811,7 +2812,8 @@ int sys_read (fds, buf, nbyte)
   int r;
 
   /* Use select to block on IO while still checking for quit_char */
-  if (!inhibit_window_system && !noninteractive)
+  if (!inhibit_window_system && !noninteractive &&
+      ! (fcntl(fds, F_GETFL, 0) & O_NONBLOCK))
     {
       FD_ZERO (&rfds);
       FD_SET (fds, &rfds);