aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorPaul Eggert2019-08-23 01:11:12 -0700
committerPaul Eggert2019-08-23 01:12:22 -0700
commit49a8c8506a8477fd27ba924f14aa196e0d0813f9 (patch)
tree6f8d118d37bdc16b27e191fa61979eda79cb7b38 /src/process.c
parent27988f136c35396e0ef1e865f5a0c0a0bf20358a (diff)
downloademacs-49a8c8506a8477fd27ba924f14aa196e0d0813f9.tar.gz
emacs-49a8c8506a8477fd27ba924f14aa196e0d0813f9.zip
Get the Gnutls code compiling on Fedora 30
The recent changes caused the build to fail on Fedora 30 when built with --enable-gcc-warnings, among other things with diagnostics that gnutls_compression_get and gnutls_compression_get_name are deprecated (this started with GnuTLS 3.6). Fix this by refusing to call these obsolescent and now-dummy functions in GnuTLS 3.6 and later. However, this is just a temporary workaround to get the build working; a real fix is needed, as network-stream-tests fail. * src/gnutls.c (HAVE_GNUTLS_COMPRESSION_GET): New macro. (gnutls_compression_get, gnutls_compression_get_name): Define only if HAVE_GNUTLS_COMPRESSION_GET. (init_gnutls_functions): Load the two functions only if HAVE_GNUTLS_COMPRESSION_GET. (emacs_gnutls_certificate_export_pem): Use alloca instead of xmalloc. (Fgnutls_peer_status): Just return "NULL" if the functions are deprecated. (Fgnutls_format_certificate): Fix pointer signedness glitches. * src/process.c: Fix spacing.
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/process.c b/src/process.c
index 7097b7ace17..c3cc78afa28 100644
--- a/src/process.c
+++ b/src/process.c
@@ -4120,10 +4120,8 @@ usage: (make-network-process &rest ARGS) */)
4120 hints.ai_socktype = socktype; 4120 hints.ai_socktype = socktype;
4121 4121
4122 msg = network_lookup_address_info_1 (host, portstring, &hints, &res); 4122 msg = network_lookup_address_info_1 (host, portstring, &hints, &res);
4123 if (!EQ(msg, Qt)) 4123 if (!EQ (msg, Qt))
4124 { 4124 error ("%s", SSDATA (msg));
4125 error ("%s", SSDATA (msg));
4126 }
4127 4125
4128 for (lres = res; lres; lres = lres->ai_next) 4126 for (lres = res; lres; lres = lres->ai_next)
4129 addrinfos = Fcons (conv_addrinfo_to_lisp (lres), addrinfos); 4127 addrinfos = Fcons (conv_addrinfo_to_lisp (lres), addrinfos);
@@ -4593,10 +4591,12 @@ network_lookup_address_info_1 (Lisp_Object host, const char *service,
4593 str = SSDATA (code_convert_string_norecord 4591 str = SSDATA (code_convert_string_norecord
4594 (build_string (str), Vlocale_coding_system, 0)); 4592 (build_string (str), Vlocale_coding_system, 0));
4595 AUTO_STRING (format, "%s/%s %s"); 4593 AUTO_STRING (format, "%s/%s %s");
4596 msg = CALLN (Fformat, format, host, build_string (service), build_string (str)); 4594 msg = CALLN (Fformat, format, host, build_string (service),
4595 build_string (str));
4597#else 4596#else
4598 AUTO_STRING (format, "%s/%s getaddrinfo error %d"); 4597 AUTO_STRING (format, "%s/%s getaddrinfo error %d");
4599 msg = CALLN (Fformat, format, host, build_string (service), make_number (ret)); 4598 msg = CALLN (Fformat, format, host, build_string (service),
4599 make_number (ret));
4600#endif 4600#endif
4601 } 4601 }
4602 return msg; 4602 return msg;
@@ -4634,18 +4634,14 @@ nil if none were found. Each address is a vector of integers. */)
4634 hints.ai_socktype = SOCK_DGRAM; 4634 hints.ai_socktype = SOCK_DGRAM;
4635 4635
4636 msg = network_lookup_address_info_1 (name, NULL, &hints, &res); 4636 msg = network_lookup_address_info_1 (name, NULL, &hints, &res);
4637 if (!EQ(msg, Qt)) 4637 if (!EQ (msg, Qt))
4638 { 4638 message ("%s", SSDATA(msg));
4639 message ("%s", SSDATA(msg));
4640 }
4641 else 4639 else
4642 { 4640 {
4643 for (lres = res; lres; lres = lres->ai_next) 4641 for (lres = res; lres; lres = lres->ai_next)
4644 { 4642 addresses = Fcons (conv_sockaddr_to_lisp (lres->ai_addr,
4645 addresses = Fcons (conv_sockaddr_to_lisp 4643 lres->ai_addrlen),
4646 (lres->ai_addr, lres->ai_addrlen), 4644 addresses);
4647 addresses);
4648 }
4649 addresses = Fnreverse (addresses); 4645 addresses = Fnreverse (addresses);
4650 4646
4651 freeaddrinfo (res); 4647 freeaddrinfo (res);