# HG changeset patch # User YAMAMOTO Mitsuharu # Date 1200047322 0 # Node ID ae78ea064d7560269e354e589a9deffbcd4c7316 # Parent 98b1ff7782394c609e855a00b2b91feedc0a1aea (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. diff -r 98b1ff778239 -r ae78ea064d75 src/mac.c --- 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);