diff options
| author | Paul Eggert | 2016-02-23 15:25:43 -0800 |
|---|---|---|
| committer | Paul Eggert | 2016-02-23 15:26:23 -0800 |
| commit | c7b8194c04687cfb97c16180feb9f9c74d9fc848 (patch) | |
| tree | 9e4fa3efed0a33423cc86a90e49519dec10c2370 /src/process.c | |
| parent | 82848cf689c24a8bc635449846250ea6edb757c4 (diff) | |
| download | emacs-c7b8194c04687cfb97c16180feb9f9c74d9fc848.tar.gz emacs-c7b8194c04687cfb97c16180feb9f9c74d9fc848.zip | |
Port to --enable-gcc-warnings sans getaddrinfo_a
* src/process.c (Fmake_network_process): Add ATTRIBUTE_UNUSED
to a local unused when getaddrinfo_a is missing.
Resize portbuf to size needed. Do cheap test first.
Move local to block where it’s needed.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/process.c b/src/process.c index 41e821e145d..b8e1973601b 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -3600,8 +3600,8 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3600 | struct Lisp_Process *p; | 3600 | struct Lisp_Process *p; |
| 3601 | #if defined HAVE_GETADDRINFO || defined HAVE_GETADDRINFO_A | 3601 | #if defined HAVE_GETADDRINFO || defined HAVE_GETADDRINFO_A |
| 3602 | const char *portstring; | 3602 | const char *portstring; |
| 3603 | ptrdiff_t portstringlen; | 3603 | ptrdiff_t portstringlen ATTRIBUTE_UNUSED; |
| 3604 | char portbuf[128]; | 3604 | char portbuf[INT_BUFSIZE_BOUND (EMACS_INT)]; |
| 3605 | #endif | 3605 | #endif |
| 3606 | #ifdef HAVE_LOCAL_SOCKETS | 3606 | #ifdef HAVE_LOCAL_SOCKETS |
| 3607 | struct sockaddr_un address_un; | 3607 | struct sockaddr_un address_un; |
| @@ -3770,7 +3770,7 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3770 | #endif | 3770 | #endif |
| 3771 | 3771 | ||
| 3772 | #ifdef HAVE_GETADDRINFO_A | 3772 | #ifdef HAVE_GETADDRINFO_A |
| 3773 | if (!NILP (Fplist_get (contact, QCnowait)) && !NILP (host)) | 3773 | if (!NILP (host) && !NILP (Fplist_get (contact, QCnowait))) |
| 3774 | { | 3774 | { |
| 3775 | ptrdiff_t hostlen = SBYTES (host); | 3775 | ptrdiff_t hostlen = SBYTES (host); |
| 3776 | struct req | 3776 | struct req |
| @@ -4897,7 +4897,6 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 4897 | 4897 | ||
| 4898 | #if defined HAVE_GETADDRINFO_A || defined HAVE_GNUTLS | 4898 | #if defined HAVE_GETADDRINFO_A || defined HAVE_GNUTLS |
| 4899 | { | 4899 | { |
| 4900 | Lisp_Object ip_addresses; | ||
| 4901 | Lisp_Object process_list_head, aproc; | 4900 | Lisp_Object process_list_head, aproc; |
| 4902 | struct Lisp_Process *p; | 4901 | struct Lisp_Process *p; |
| 4903 | 4902 | ||
| @@ -4911,7 +4910,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 4911 | /* Check for pending DNS requests. */ | 4910 | /* Check for pending DNS requests. */ |
| 4912 | if (p->dns_request) | 4911 | if (p->dns_request) |
| 4913 | { | 4912 | { |
| 4914 | ip_addresses = check_for_dns (aproc); | 4913 | Lisp_Object ip_addresses = check_for_dns (aproc); |
| 4915 | if (!NILP (ip_addresses) && !EQ (ip_addresses, Qt)) | 4914 | if (!NILP (ip_addresses) && !EQ (ip_addresses, Qt)) |
| 4916 | connect_network_socket (aproc, ip_addresses); | 4915 | connect_network_socket (aproc, ip_addresses); |
| 4917 | } | 4916 | } |