diff options
Diffstat (limited to 'src/mac.c')
| -rw-r--r-- | src/mac.c | 7 |
1 files changed, 6 insertions, 1 deletions
| @@ -5013,6 +5013,9 @@ extern int noninteractive; | |||
| 5013 | sys_select. */ | 5013 | sys_select. */ |
| 5014 | static CFMutableDictionaryRef cfsockets_for_select; | 5014 | static CFMutableDictionaryRef cfsockets_for_select; |
| 5015 | 5015 | ||
| 5016 | /* Process ID of Emacs. */ | ||
| 5017 | static pid_t mac_emacs_pid; | ||
| 5018 | |||
| 5016 | static void | 5019 | static void |
| 5017 | socket_callback (s, type, address, data, info) | 5020 | socket_callback (s, type, address, data, info) |
| 5018 | CFSocketRef s; | 5021 | CFSocketRef s; |
| @@ -5092,7 +5095,7 @@ mac_try_close_socket (fd) | |||
| 5092 | int fd; | 5095 | int fd; |
| 5093 | { | 5096 | { |
| 5094 | #if SELECT_USE_CFSOCKET | 5097 | #if SELECT_USE_CFSOCKET |
| 5095 | if (cfsockets_for_select) | 5098 | if (getpid () == mac_emacs_pid && cfsockets_for_select) |
| 5096 | { | 5099 | { |
| 5097 | void *key = (void *) fd; | 5100 | void *key = (void *) fd; |
| 5098 | CFSocketRef socket = | 5101 | CFSocketRef socket = |
| @@ -5329,6 +5332,8 @@ init_mac_osx_environment () | |||
| 5329 | char *p, *q; | 5332 | char *p, *q; |
| 5330 | struct stat st; | 5333 | struct stat st; |
| 5331 | 5334 | ||
| 5335 | mac_emacs_pid = getpid (); | ||
| 5336 | |||
| 5332 | /* Initialize locale related variables. */ | 5337 | /* Initialize locale related variables. */ |
| 5333 | mac_system_script_code = | 5338 | mac_system_script_code = |
| 5334 | (ScriptCode) GetScriptManagerVariable (smSysScript); | 5339 | (ScriptCode) GetScriptManagerVariable (smSysScript); |