diff options
Diffstat (limited to 'editors/emacs/patches/patch-aj')
-rw-r--r-- | editors/emacs/patches/patch-aj | 65 |
1 files changed, 23 insertions, 42 deletions
diff --git a/editors/emacs/patches/patch-aj b/editors/emacs/patches/patch-aj index 2c9ef872f58..4d82ab30e0e 100644 --- a/editors/emacs/patches/patch-aj +++ b/editors/emacs/patches/patch-aj @@ -1,27 +1,7 @@ -$NetBSD: patch-aj,v 1.4 2000/03/09 16:00:10 minoura Exp $ +$NetBSD: patch-aj,v 1.5 2000/03/16 15:40:22 minoura Exp $ -From lha@stacken.kth.se Mon Feb 28 03:43:18 2000 -Date: Sun, 27 Feb 2000 16:26:07 +0100 -From: Love <lha@stacken.kth.se> -To: tech-pkg@netbsd.org -Subject: editor/emacs - - -Hi - -Emacs is ipv6 enable, great. But it doesn't loop over all addresses it -get back from getaddrinfo. This causes problem if your ipv6 tunnel is -done, but you still have ipv4 connectivity. - -The patch below saves the first errno, and the retries all addresses -until it runs out of them. - -Thanks, -Love - - ---- src/process.c.orig Thu Jul 8 07:36:24 1999 -+++ src/process.c Fri Mar 10 00:42:11 2000 +--- src/process.c.orig Tue Feb 15 19:16:26 2000 ++++ src/process.c Fri Mar 17 00:02:40 2000 @@ -1,7 +1,18 @@ +/* + * Locally hacked process.c to add ipv6 support. -wsr @@ -41,7 +21,7 @@ Love This file is part of GNU Emacs. GNU Emacs is free software; you can redistribute it and/or modify -@@ -1806,15 +1817,22 @@ +@@ -1806,15 +1817,21 @@ { Lisp_Object proc; register int i; @@ -58,7 +38,6 @@ Love struct hostent host_info_fixed; + int port; +#else /* HAVE_GETADDRINFO */ -+ int saved_errno; + struct addrinfo hints, *res, *lres; + int ret; + char *portstring, portbuf [128]; @@ -67,7 +46,7 @@ Love struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; int retry = 0; int count = specpdl_ptr - specpdl; -@@ -1827,6 +1845,22 @@ +@@ -1827,6 +1844,22 @@ GCPRO4 (name, buffer, host, service); CHECK_STRING (name, 0); CHECK_STRING (host, 0); @@ -90,7 +69,7 @@ Love if (INTEGERP (service)) port = htons ((unsigned short) XINT (service)); else -@@ -1837,6 +1871,8 @@ +@@ -1837,6 +1870,8 @@ error ("Unknown service \"%s\"", XSTRING (service)->data); port = svc_info->s_port; } @@ -99,7 +78,7 @@ Love /* Slow down polling to every ten seconds. Some kernels have a bug which causes retrying connect to fail -@@ -1846,6 +1882,86 @@ +@@ -1846,6 +1881,88 @@ #endif #ifndef TERM @@ -127,7 +106,8 @@ Love + immediate_quit = 0; + } + -+ for (lres = res; lres ; lres = lres->ai_next){ /* address loop */ ++ lres = res; ++ addrloop: /* address loop */ + s = socket(lres->ai_family, lres->ai_socktype, lres->ai_protocol); + if (s < 0) + report_file_error ("error creating socket", Fcons (name, Qnil)); @@ -149,7 +129,7 @@ Love + if (connect(s, lres->ai_addr, lres->ai_addrlen) == -1 + && errno != EISCONN) + { -+ saved_errno = errno; ++ int xerrno = errno; + + immediate_quit = 0; + @@ -167,18 +147,19 @@ Love + + close (s); + -+ if (lres == NULL) { -+ -+ if (interrupt_input) -+ request_sigio (); -+ -+ errno = saved_errno; -+ report_file_error ("connection failed", -+ Fcons (host, Fcons (name, Qnil))); -+ } ++ if (interrupt_input) ++ request_sigio (); ++ ++ if (lres->ai_next) { ++ lres = lres->ai_next; ++ goto addrloop; ++ } ++ ++ ++ errno = xerrno; ++ report_file_error ("connection failed", ++ Fcons (host, Fcons (name, Qnil))); + } -+ else -+ break; + } /* address loop */ + freeaddrinfo(res); +#else /* HAVE_GETADDRINFO */ @@ -186,7 +167,7 @@ Love while (1) { #ifdef TRY_AGAIN -@@ -1936,6 +2052,7 @@ +@@ -1936,6 +2053,7 @@ report_file_error ("connection failed", Fcons (host, Fcons (name, Qnil))); } |