diff options
Diffstat (limited to 'src/mac.c')
| -rw-r--r-- | src/mac.c | 7 |
1 files changed, 6 insertions, 1 deletions
| @@ -5008,6 +5008,9 @@ extern int noninteractive; | |||
| 5008 | sys_select. */ | 5008 | sys_select. */ |
| 5009 | static CFMutableDictionaryRef cfsockets_for_select; | 5009 | static CFMutableDictionaryRef cfsockets_for_select; |
| 5010 | 5010 | ||
| 5011 | /* Process ID of Emacs. */ | ||
| 5012 | static pid_t mac_emacs_pid; | ||
| 5013 | |||
| 5011 | static void | 5014 | static void |
| 5012 | socket_callback (s, type, address, data, info) | 5015 | socket_callback (s, type, address, data, info) |
| 5013 | CFSocketRef s; | 5016 | CFSocketRef s; |
| @@ -5103,7 +5106,7 @@ mac_try_close_socket (fd) | |||
| 5103 | int fd; | 5106 | int fd; |
| 5104 | { | 5107 | { |
| 5105 | #if SELECT_USE_CFSOCKET | 5108 | #if SELECT_USE_CFSOCKET |
| 5106 | if (cfsockets_for_select) | 5109 | if (getpid () == mac_emacs_pid && cfsockets_for_select) |
| 5107 | { | 5110 | { |
| 5108 | void *key = (void *) fd; | 5111 | void *key = (void *) fd; |
| 5109 | CFSocketRef socket = | 5112 | CFSocketRef socket = |
| @@ -5339,6 +5342,8 @@ init_mac_osx_environment () | |||
| 5339 | char *p, *q; | 5342 | char *p, *q; |
| 5340 | struct stat st; | 5343 | struct stat st; |
| 5341 | 5344 | ||
| 5345 | mac_emacs_pid = getpid (); | ||
| 5346 | |||
| 5342 | /* Initialize locale related variables. */ | 5347 | /* Initialize locale related variables. */ |
| 5343 | mac_system_script_code = | 5348 | mac_system_script_code = |
| 5344 | (ScriptCode) GetScriptManagerVariable (smSysScript); | 5349 | (ScriptCode) GetScriptManagerVariable (smSysScript); |