changeset 79821:ae78ea064d75

(mac_emacs_pid) [MAC_OSX]: New variable. [MAC_OSX] (init_mac_osx_environment): Initialize it. [MAC_OSX] (mac_try_close_socket) [SELECT_USE_CFSOCKET]: Return 0 when used on child processes.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Fri, 11 Jan 2008 10:28:42 +0000
parents 98b1ff778239
children ba94e0a67c35
files src/mac.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/mac.c	Fri Jan 11 09:56:04 2008 +0000
+++ b/src/mac.c	Fri Jan 11 10:28:42 2008 +0000
@@ -5013,6 +5013,9 @@
    sys_select.  */
 static CFMutableDictionaryRef cfsockets_for_select;
 
+/* Process ID of Emacs.  */
+static pid_t mac_emacs_pid;
+
 static void
 socket_callback (s, type, address, data, info)
      CFSocketRef s;
@@ -5092,7 +5095,7 @@
      int fd;
 {
 #if SELECT_USE_CFSOCKET
-  if (cfsockets_for_select)
+  if (getpid () == mac_emacs_pid && cfsockets_for_select)
     {
       void *key = (void *) fd;
       CFSocketRef socket =
@@ -5329,6 +5332,8 @@
   char *p, *q;
   struct stat st;
 
+  mac_emacs_pid = getpid ();
+
   /* Initialize locale related variables.  */
   mac_system_script_code =
     (ScriptCode) GetScriptManagerVariable (smSysScript);