[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/mac.c
From: |
Andrew Choi |
Subject: |
[Emacs-diffs] Changes to emacs/src/mac.c |
Date: |
Sat, 10 Aug 2002 20:26:24 -0400 |
Index: emacs/src/mac.c
diff -c emacs/src/mac.c:1.7 emacs/src/mac.c:1.8
*** emacs/src/mac.c:1.7 Fri Aug 2 16:34:38 2002
--- emacs/src/mac.c Sat Aug 10 20:26:24 2002
***************
*** 2745,2750 ****
--- 2745,2774 ----
return Qnil;
}
+ #ifdef MAC_OSX
+ #undef select
+
+ extern int inhibit_window_system;
+
+ /* When Emacs is started from the Finder, SELECT always immediately
+ returns as if input is present when file descriptor 0 is polled for
+ input. Strangely, when Emacs is run as a GUI application from the
+ command line, it blocks in the same situation. This `wrapper' of
+ the system call SELECT corrects this discrepancy. */
+ int
+ sys_select (n, rfds, wfds, efds, timeout)
+ int n;
+ SELECT_TYPE *rfds;
+ SELECT_TYPE *wfds;
+ SELECT_TYPE *efds;
+ struct timeval *timeout;
+ {
+ if (!inhibit_window_system && rfds && FD_ISSET (0, rfds))
+ return 1;
+ else
+ return select (n, rfds, wfds, efds, timeout);
+ }
+ #endif /* MAC_OSX */
void
syms_of_mac ()