aboutsummaryrefslogtreecommitdiffstats
path: root/src/mac.c
diff options
context:
space:
mode:
authorAndrew Choi2002-08-11 00:26:24 +0000
committerAndrew Choi2002-08-11 00:26:24 +0000
commit8030369ccb5c871d3ce11b96c220f318bc741ed8 (patch)
treeb2989661fb58dd8d3c70d7c915a98dd444dee1c1 /src/mac.c
parent1e7c162fa46946be3686f97470dd2b1f4eb0ab7d (diff)
downloademacs-8030369ccb5c871d3ce11b96c220f318bc741ed8.tar.gz
emacs-8030369ccb5c871d3ce11b96c220f318bc741ed8.zip
2002-08-10 Andrew Choi <akochoi@shaw.ca>
* mac.c (sys_select) [MAC_OSX]: New function. * macterm.c (MakeMeTheFrontProcess): New function. (mac_initialize): Call MakeMeTheFrontProcess. * s/darwin.h: Define select to sys_select.
Diffstat (limited to 'src/mac.c')
-rw-r--r--src/mac.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mac.c b/src/mac.c
index 6070c6a0dc7..a9c97849d55 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -2745,6 +2745,30 @@ and t is the same as `SECONDARY'. */)
2745 return Qnil; 2745 return Qnil;
2746} 2746}
2747 2747
2748#ifdef MAC_OSX
2749#undef select
2750
2751extern int inhibit_window_system;
2752
2753/* When Emacs is started from the Finder, SELECT always immediately
2754 returns as if input is present when file descriptor 0 is polled for
2755 input. Strangely, when Emacs is run as a GUI application from the
2756 command line, it blocks in the same situation. This `wrapper' of
2757 the system call SELECT corrects this discrepancy. */
2758int
2759sys_select (n, rfds, wfds, efds, timeout)
2760 int n;
2761 SELECT_TYPE *rfds;
2762 SELECT_TYPE *wfds;
2763 SELECT_TYPE *efds;
2764 struct timeval *timeout;
2765{
2766 if (!inhibit_window_system && rfds && FD_ISSET (0, rfds))
2767 return 1;
2768 else
2769 return select (n, rfds, wfds, efds, timeout);
2770}
2771#endif /* MAC_OSX */
2748 2772
2749void 2773void
2750syms_of_mac () 2774syms_of_mac ()