changeset 48787:0360bdd5a70b

Fixed OSX sys_read to not call select if IO is non-blocking
author Steven Tamm <steventamm@mac.com>
date Tue, 10 Dec 2002 16:47:49 +0000
parents 90cdeb7dd535
children 988ef6c7ddda
files src/mac.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/mac.c	Tue Dec 10 13:20:09 2002 +0000
+++ b/src/mac.c	Tue Dec 10 16:47:49 2002 +0000
@@ -32,6 +32,7 @@
 #include <pwd.h>
 #include <sys/param.h>
 #include <stdlib.h>
+#include <fcntl.h>
 #if __MWERKS__
 #include <unistd.h>
 #endif
@@ -2811,7 +2812,8 @@
   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);