commit f0b31080140217bf90772a39c66088069f466d8b (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Wed Mar 9 16:24:59 2016 -0800 Minor fixes for getaddrinfo_a usage * src/process.c (Fdelete_process): Check gai_cancel return value. That way, there’s no need to invoke gai_error. Check gai_suspend return value. (Fmake_network_process): Don’t assume gai_strerror returns a UTF-8 string. Simplify call to connect_network_socket. (check_for_dns): Avoid unnecessary initialization of local. diff --git a/src/process.c b/src/process.c index 359cd21..56f036c 100644 --- a/src/process.c +++ b/src/process.c @@ -845,23 +845,19 @@ nil, indicating the current buffer's process. */) #ifdef HAVE_GETADDRINFO_A if (p->dns_request) { - int ret; + /* Cancel the request. Unless shutting down, wait until + completion. Free the request if completely canceled. */ - gai_cancel (p->dns_request); - ret = gai_error (p->dns_request); - if (ret == EAI_CANCELED || ret == 0) - free_dns_request (process); - else + bool canceled = gai_cancel (p->dns_request) != EAI_NOTCANCELED; + if (!canceled && !inhibit_sentinels) { - /* 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 ((struct gaicb const **) &p->dns_request, 1, NULL); - free_dns_request (process); - } + struct gaicb const *req = p->dns_request; + while (gai_suspend (&req, 1, NULL) != 0) + continue; + canceled = true; } + if (canceled) + free_dns_request (process); } #endif @@ -3814,7 +3810,14 @@ usage: (make-network-process &rest ARGS) */) ret = getaddrinfo (SSDATA (host), portstring, &hints, &res); if (ret) #ifdef HAVE_GAI_STRERROR - error ("%s/%s %s", SSDATA (host), portstring, gai_strerror (ret)); + { + synchronize_system_messages_locale (); + char const *str = gai_strerror (ret); + if (! NILP (Vlocale_coding_system)) + str = SSDATA (code_convert_string_norecord + (build_string (str), Vlocale_coding_system, 0)); + error ("%s/%s %s", SSDATA (host), portstring, str); + } #else error ("%s/%s getaddrinfo error %d", SSDATA (host), portstring, ret); #endif @@ -3932,21 +3935,17 @@ usage: (make-network-process &rest ARGS) */) } #ifdef HAVE_GETADDRINFO_A - /* If we're doing async address resolution, the list of addresses - here will be nil, so we postpone connecting to the server. */ + /* With async address resolution, the list of addresses is empty, so + postpone connecting to the server. */ if (!p->is_server && NILP (ip_addresses)) { p->dns_request = dns_request; p->status = Qconnect; + return proc; } - else - { - connect_network_socket (proc, ip_addresses); - } -#else /* HAVE_GETADDRINFO_A */ - connect_network_socket (proc, ip_addresses); #endif + connect_network_socket (proc, ip_addresses); return proc; } @@ -4657,13 +4656,12 @@ check_for_dns (Lisp_Object proc) { struct Lisp_Process *p = XPROCESS (proc); Lisp_Object ip_addresses = Qnil; - int ret = 0; /* Sanity check. */ if (! p->dns_request) return Qnil; - ret = gai_error (p->dns_request); + int ret = gai_error (p->dns_request); if (ret == EAI_INPROGRESS) return Qt; commit 7801999f79519326e1073be878f7ada50a492542 Author: Sam Steingold Date: Wed Mar 9 08:53:49 2016 -0500 declare `rmail-mime-entity-truncated' and `rmail-mime-render-html-function' The former avoids a compiler warning, the latter fixes a bug whereas the variable is compiled as lexical instead of dynamic. diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 2790c89..68b3cfd 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -241,6 +241,7 @@ please report it with \\[report-emacs-bug].") (declare-function mail-dont-reply-to "mail-utils" (destinations)) (declare-function rmail-update-summary "rmailsum" (&rest ignore)) (declare-function rmail-mime-toggle-hidden "rmailmm" ()) +(declare-function rmail-mime-entity-truncated "rmailmm" (entity)) (defun rmail-probe (prog) "Determine what flavor of movemail PROG is. @@ -4583,6 +4584,7 @@ Argument MIME is non-nil if this is a mime message." ;; There doesn't really seem to be an appropriate menu. ;; Eg the edit command is not in a menu either. +(defvar rmail-mime-render-html-function) ; defcustom in rmailmm (defun rmail-epa-decrypt () "Decrypt GnuPG or OpenPGP armors in current message." (interactive)