[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 9671650: Wait for async DNS to complete before free
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master 9671650: Wait for async DNS to complete before freeing resources |
Date: |
Mon, 29 Feb 2016 03:20:28 +0000 |
branch: master
commit 9671650a7c76b4dc2c74a6ae6258def228a26d95
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
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.
---
src/process.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/src/process.c b/src/process.c
index a321244..d83e2d2 100644
--- a/src/process.c
+++ b/src/process.c
@@ -845,8 +845,24 @@ nil, indicating the current buffer's process. */)
#ifdef HAVE_GETADDRINFO_A
if (p->dns_request)
{
+ int ret;
+
gai_cancel (p->dns_request);
- free_dns_request (process);
+ ret = gai_error (p->dns_request);
+ if (ret == EAI_CANCELED || ret == 0)
+ free_dns_request (process);
+ else
+ {
+ /* If we're called during shutdown, we don't really about
+ freeing all the resources. Otherwise wait until
+ completion, and then free the request. */
+ if (! inhibit_sentinels)
+ {
+ gai_suspend ((const struct gaicb * const*)&p->dns_request,
+ 1, NULL);
+ free_dns_request (process);
+ }
+ }
}
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 9671650: Wait for async DNS to complete before freeing resources,
Lars Ingebrigtsen <=