diff options
| author | Lars Ingebrigtsen | 2016-02-29 14:20:09 +1100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2016-02-29 14:20:09 +1100 |
| commit | 9671650a7c76b4dc2c74a6ae6258def228a26d95 (patch) | |
| tree | b17ce2f89203e5dff08ace89743a7d2a7c06dc23 /src/process.c | |
| parent | f195dd692bfc1911e85f92145df57a2dba460f58 (diff) | |
| download | emacs-9671650a7c76b4dc2c74a6ae6258def228a26d95.tar.gz emacs-9671650a7c76b4dc2c74a6ae6258def228a26d95.zip | |
Wait for async DNS to complete before freeing resources
* src/process.c (Fdelete_process): Wait for async DNS to
complete before freeing the data structures it needs.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/process.c b/src/process.c index a3212445cde..d83e2d2c51f 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -845,8 +845,24 @@ nil, indicating the current buffer's process. */) | |||
| 845 | #ifdef HAVE_GETADDRINFO_A | 845 | #ifdef HAVE_GETADDRINFO_A |
| 846 | if (p->dns_request) | 846 | if (p->dns_request) |
| 847 | { | 847 | { |
| 848 | int ret; | ||
| 849 | |||
| 848 | gai_cancel (p->dns_request); | 850 | gai_cancel (p->dns_request); |
| 849 | free_dns_request (process); | 851 | ret = gai_error (p->dns_request); |
| 852 | if (ret == EAI_CANCELED || ret == 0) | ||
| 853 | free_dns_request (process); | ||
| 854 | else | ||
| 855 | { | ||
| 856 | /* If we're called during shutdown, we don't really about | ||
| 857 | freeing all the resources. Otherwise wait until | ||
| 858 | completion, and then free the request. */ | ||
| 859 | if (! inhibit_sentinels) | ||
| 860 | { | ||
| 861 | gai_suspend ((const struct gaicb * const*)&p->dns_request, | ||
| 862 | 1, NULL); | ||
| 863 | free_dns_request (process); | ||
| 864 | } | ||
| 865 | } | ||
| 850 | } | 866 | } |
| 851 | #endif | 867 | #endif |
| 852 | 868 | ||