aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Mackenzie2016-03-10 11:46:36 +0000
committerAlan Mackenzie2016-03-10 11:46:36 +0000
commitae6dc08e0c5961cd10469eefb3c78f6e8c14158b (patch)
tree20724aaa6651a07bd46f917169c288123ef9bb71 /src
parentf7adb8a4efa6b95d63433728c1dd0353cde6a2e4 (diff)
parent2d382515bfdb44d585bda6515f8d03f9056a83ef (diff)
downloademacs-ae6dc08e0c5961cd10469eefb3c78f6e8c14158b.tar.gz
emacs-ae6dc08e0c5961cd10469eefb3c78f6e8c14158b.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'src')
-rw-r--r--src/process.c48
-rw-r--r--src/xfns.c3
2 files changed, 24 insertions, 27 deletions
diff --git a/src/process.c b/src/process.c
index 359cd2195aa..56f036cd7d2 100644
--- a/src/process.c
+++ b/src/process.c
@@ -845,23 +845,19 @@ 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; 848 /* Cancel the request. Unless shutting down, wait until
849 completion. Free the request if completely canceled. */
849 850
850 gai_cancel (p->dns_request); 851 bool canceled = gai_cancel (p->dns_request) != EAI_NOTCANCELED;
851 ret = gai_error (p->dns_request); 852 if (!canceled && !inhibit_sentinels)
852 if (ret == EAI_CANCELED || ret == 0)
853 free_dns_request (process);
854 else
855 { 853 {
856 /* If we're called during shutdown, we don't really about 854 struct gaicb const *req = p->dns_request;
857 freeing all the resources. Otherwise wait until 855 while (gai_suspend (&req, 1, NULL) != 0)
858 completion, and then free the request. */ 856 continue;
859 if (! inhibit_sentinels) 857 canceled = true;
860 {
861 gai_suspend ((struct gaicb const **) &p->dns_request, 1, NULL);
862 free_dns_request (process);
863 }
864 } 858 }
859 if (canceled)
860 free_dns_request (process);
865 } 861 }
866#endif 862#endif
867 863
@@ -3814,7 +3810,14 @@ usage: (make-network-process &rest ARGS) */)
3814 ret = getaddrinfo (SSDATA (host), portstring, &hints, &res); 3810 ret = getaddrinfo (SSDATA (host), portstring, &hints, &res);
3815 if (ret) 3811 if (ret)
3816#ifdef HAVE_GAI_STRERROR 3812#ifdef HAVE_GAI_STRERROR
3817 error ("%s/%s %s", SSDATA (host), portstring, gai_strerror (ret)); 3813 {
3814 synchronize_system_messages_locale ();
3815 char const *str = gai_strerror (ret);
3816 if (! NILP (Vlocale_coding_system))
3817 str = SSDATA (code_convert_string_norecord
3818 (build_string (str), Vlocale_coding_system, 0));
3819 error ("%s/%s %s", SSDATA (host), portstring, str);
3820 }
3818#else 3821#else
3819 error ("%s/%s getaddrinfo error %d", SSDATA (host), portstring, ret); 3822 error ("%s/%s getaddrinfo error %d", SSDATA (host), portstring, ret);
3820#endif 3823#endif
@@ -3932,21 +3935,17 @@ usage: (make-network-process &rest ARGS) */)
3932 } 3935 }
3933 3936
3934#ifdef HAVE_GETADDRINFO_A 3937#ifdef HAVE_GETADDRINFO_A
3935 /* If we're doing async address resolution, the list of addresses 3938 /* With async address resolution, the list of addresses is empty, so
3936 here will be nil, so we postpone connecting to the server. */ 3939 postpone connecting to the server. */
3937 if (!p->is_server && NILP (ip_addresses)) 3940 if (!p->is_server && NILP (ip_addresses))
3938 { 3941 {
3939 p->dns_request = dns_request; 3942 p->dns_request = dns_request;
3940 p->status = Qconnect; 3943 p->status = Qconnect;
3944 return proc;
3941 } 3945 }
3942 else
3943 {
3944 connect_network_socket (proc, ip_addresses);
3945 }
3946#else /* HAVE_GETADDRINFO_A */
3947 connect_network_socket (proc, ip_addresses);
3948#endif 3946#endif
3949 3947
3948 connect_network_socket (proc, ip_addresses);
3950 return proc; 3949 return proc;
3951} 3950}
3952 3951
@@ -4657,13 +4656,12 @@ check_for_dns (Lisp_Object proc)
4657{ 4656{
4658 struct Lisp_Process *p = XPROCESS (proc); 4657 struct Lisp_Process *p = XPROCESS (proc);
4659 Lisp_Object ip_addresses = Qnil; 4658 Lisp_Object ip_addresses = Qnil;
4660 int ret = 0;
4661 4659
4662 /* Sanity check. */ 4660 /* Sanity check. */
4663 if (! p->dns_request) 4661 if (! p->dns_request)
4664 return Qnil; 4662 return Qnil;
4665 4663
4666 ret = gai_error (p->dns_request); 4664 int ret = gai_error (p->dns_request);
4667 if (ret == EAI_INPROGRESS) 4665 if (ret == EAI_INPROGRESS)
4668 return Qt; 4666 return Qt;
4669 4667
diff --git a/src/xfns.c b/src/xfns.c
index c1ce1b73a21..596b67c1608 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -5354,7 +5354,6 @@ x_create_tip_frame (struct x_display_info *dpyinfo, Lisp_Object parms)
5354 int width, height; 5354 int width, height;
5355 ptrdiff_t count = SPECPDL_INDEX (); 5355 ptrdiff_t count = SPECPDL_INDEX ();
5356 bool face_change_before = face_change; 5356 bool face_change_before = face_change;
5357 Lisp_Object buffer;
5358 int x_width = 0, x_height = 0; 5357 int x_width = 0, x_height = 0;
5359 5358
5360 if (!dpyinfo->terminal->name) 5359 if (!dpyinfo->terminal->name)
@@ -5873,6 +5872,7 @@ Text larger than the specified size is clipped. */)
5873 ptrdiff_t count = SPECPDL_INDEX (); 5872 ptrdiff_t count = SPECPDL_INDEX ();
5874 ptrdiff_t count_1; 5873 ptrdiff_t count_1;
5875 Lisp_Object window, size; 5874 Lisp_Object window, size;
5875 AUTO_STRING (tip, " *tip*");
5876 5876
5877 specbind (Qinhibit_redisplay, Qt); 5877 specbind (Qinhibit_redisplay, Qt);
5878 5878
@@ -6036,7 +6036,6 @@ Text larger than the specified size is clipped. */)
6036 6036
6037 tip_f = XFRAME (tip_frame); 6037 tip_f = XFRAME (tip_frame);
6038 window = FRAME_ROOT_WINDOW (tip_f); 6038 window = FRAME_ROOT_WINDOW (tip_f);
6039 AUTO_STRING (tip, " *tip*");
6040 set_window_buffer (window, Fget_buffer_create (tip), false, false); 6039 set_window_buffer (window, Fget_buffer_create (tip), false, false);
6041 w = XWINDOW (window); 6040 w = XWINDOW (window);
6042 w->pseudo_window_p = true; 6041 w->pseudo_window_p = true;