/[emacs]/emacs/src/mac.c
ViewVC logotype

Diff of /emacs/src/mac.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by tamm, Thu Dec 12 17:10:34 2002 UTC revision 1.15 by lektu, Tue Feb 4 14:03:12 2003 UTC
# Line 2770  sys_select (n, rfds, wfds, efds, timeout Line 2770  sys_select (n, rfds, wfds, efds, timeout
2770    if (!inhibit_window_system && rfds && FD_ISSET (0, rfds))    if (!inhibit_window_system && rfds && FD_ISSET (0, rfds))
2771      return 1;      return 1;
2772    else if (inhibit_window_system || noninteractive ||    else if (inhibit_window_system || noninteractive ||
2773             (timeout && (EMACS_SECS(*timeout)==0) &&             (timeout && (EMACS_SECS(*timeout)==0) &&
2774              (EMACS_USECS(*timeout)==0)))              (EMACS_USECS(*timeout)==0)))
2775      return select(n, rfds, wfds, efds, timeout);      return select(n, rfds, wfds, efds, timeout);
2776    else    else
# Line 2780  sys_select (n, rfds, wfds, efds, timeout Line 2780  sys_select (n, rfds, wfds, efds, timeout
2780        EMACS_GET_TIME (end_time);        EMACS_GET_TIME (end_time);
2781        if (timeout)        if (timeout)
2782          EMACS_ADD_TIME (end_time, end_time, *timeout);          EMACS_ADD_TIME (end_time, end_time, *timeout);
2783          
2784        do        do
2785          {          {
2786            int r;            int r;
2787            EMACS_TIME one_second;            EMACS_TIME one_second;
2788            SELECT_TYPE orfds;            SELECT_TYPE orfds;
2789              
2790            FD_ZERO (&orfds);            FD_ZERO (&orfds);
2791            if (rfds)            if (rfds)
2792              {              {
2793                orfds = *rfds;                orfds = *rfds;
2794              }              }
2795              
2796            EMACS_SET_SECS (one_second, 1);            EMACS_SET_SECS (one_second, 1);
2797            EMACS_SET_USECS (one_second, 0);            EMACS_SET_USECS (one_second, 0);
2798              
2799            if (timeout && EMACS_TIME_LT(*timeout, one_second))            if (timeout && EMACS_TIME_LT(*timeout, one_second))
2800              one_second = *timeout;              one_second = *timeout;
2801    
# Line 2806  sys_select (n, rfds, wfds, efds, timeout Line 2806  sys_select (n, rfds, wfds, efds, timeout
2806              }              }
2807    
2808            mac_check_for_quit_char();            mac_check_for_quit_char();
2809              
2810            EMACS_GET_TIME (now);            EMACS_GET_TIME (now);
2811            EMACS_SUB_TIME (now, end_time, now);            EMACS_SUB_TIME (now, end_time, now);
2812          }          }
2813        while (!timeout || !EMACS_TIME_NEG_P (now));        while (!timeout || !EMACS_TIME_NEG_P (now));
2814          
2815        return 0;        return 0;
2816      }      }
2817  }  }
# Line 2835  int sys_read (fds, buf, nbyte) Line 2835  int sys_read (fds, buf, nbyte)
2835        if (sys_select (fds+1, &rfds, 0, 0, NULL) < 0)        if (sys_select (fds+1, &rfds, 0, 0, NULL) < 0)
2836          return -1;          return -1;
2837      }      }
2838          
2839    return read (fds, buf, nbyte);    return read (fds, buf, nbyte);
2840  }  }
2841    

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26