unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob da37881988ffb790335d109b5dfb4b6e0fb419c2 4221 bytes (raw)
name: gnu/packages/patches/glibc-2-26-0022.patch 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
 
From bdd8422cfb1fe04cb20617495156fb232b00d23c Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Fri, 1 Sep 2017 08:56:46 +0200
Subject: [PATCH 22/90] getaddrinfo: Use &errno has the errno pointer

Similar code in nss/getXXbyYY_r.c is already using &errno as the
argument.

(cherry picked from commit 924b121c5978689001ae28cf1c8497371dad4f71)

diff --git a/ChangeLog b/ChangeLog
index 591c753fcc..04304bb929 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-09-01  Florian Weimer  <fweimer@redhat.com>
+
+	* sysdeps/posix/getaddrinfo.c (gethosts): Use errno directly.
+	(getcanonname): Likewise.
+	(gaih_inet): Likewise.
+
 2017-08-08  Florian Weimer  <fweimer@redhat.com>
 
 	* sysdeps/posix/getaddrinfo.c (gaih_inet): Remove unreachable
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 09f85fc472..1a16820b7e 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -247,11 +247,10 @@ convert_hostent_to_gaih_addrtuple (const struct addrinfo *req,
   char *localcanon = NULL;						      \
   no_data = 0;								      \
   while (1) {								      \
-    rc = 0;								      \
     status = DL_CALL_FCT (fct, (name, _family, &th,			      \
 				tmpbuf->data, tmpbuf->length,		      \
-				&rc, &herrno, NULL, &localcanon));	      \
-    if (rc != ERANGE || herrno != NETDB_INTERNAL)			      \
+				&errno, &herrno, NULL, &localcanon));	      \
+    if (errno != ERANGE || herrno != NETDB_INTERNAL)			      \
       break;								      \
     if (!scratch_buffer_grow (tmpbuf))					      \
       {									      \
@@ -261,11 +260,11 @@ convert_hostent_to_gaih_addrtuple (const struct addrinfo *req,
 	goto free_and_return;						      \
       }									      \
   }									      \
-  if (status == NSS_STATUS_SUCCESS && rc == 0)				      \
+  if (status == NSS_STATUS_SUCCESS && errno == 0)			      \
     h = &th;								      \
   else									      \
     h = NULL;								      \
-  if (rc != 0)								      \
+  if (errno != 0)							      \
     {									      \
       if (herrno == NETDB_INTERNAL)					      \
 	{								      \
@@ -335,9 +334,8 @@ getcanonname (service_user *nip, struct gaih_addrtuple *at, const char *name)
     {
       char buf[256];
       int herrno;
-      int rc;
       if (DL_CALL_FCT (cfct, (at->name ?: name, buf, sizeof (buf),
-			      &s, &rc, &herrno)) != NSS_STATUS_SUCCESS)
+			      &s, &errno, &herrno)) != NSS_STATUS_SUCCESS)
 	/* If the canonical name cannot be determined, use the passed
 	   string.  */
 	s = (char *) name;
@@ -353,7 +351,6 @@ gaih_inet (const char *name, const struct gaih_service *service,
   const struct gaih_typeproto *tp = gaih_inet_typeproto;
   struct gaih_servtuple *st = (struct gaih_servtuple *) &nullserv;
   struct gaih_addrtuple *at = NULL;
-  int rc;
   bool got_ipv6 = false;
   const char *canon = NULL;
   const char *orig_name = name;
@@ -395,7 +392,8 @@ gaih_inet (const char *name, const struct gaih_service *service,
 	      st = (struct gaih_servtuple *)
 		alloca_account (sizeof (struct gaih_servtuple), alloca_used);
 
-	      if ((rc = gaih_inet_serv (service->name, tp, req, st, tmpbuf)))
+	      int rc = gaih_inet_serv (service->name, tp, req, st, tmpbuf);
+	      if (__glibc_unlikely (rc != 0))
 		return rc;
 	    }
 	  else
@@ -495,7 +493,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 	    idn_flags |= IDNA_USE_STD3_ASCII_RULES;
 
 	  char *p = NULL;
-	  rc = __idna_to_ascii_lz (name, &p, idn_flags);
+	  int rc = __idna_to_ascii_lz (name, &p, idn_flags);
 	  if (rc != IDNA_SUCCESS)
 	    {
 	      /* No need to jump to free_and_return here.  */
@@ -793,15 +791,14 @@ gaih_inet (const char *name, const struct gaih_service *service,
 
 		  while (1)
 		    {
-		      rc = 0;
 		      status = DL_CALL_FCT (fct4, (name, pat,
 						   tmpbuf->data, tmpbuf->length,
-						   &rc, &herrno,
+						   &errno, &herrno,
 						   NULL));
 		      if (status == NSS_STATUS_SUCCESS)
 			break;
 		      if (status != NSS_STATUS_TRYAGAIN
-			  || rc != ERANGE || herrno != NETDB_INTERNAL)
+			  || errno != ERANGE || herrno != NETDB_INTERNAL)
 			{
 			  if (herrno == TRY_AGAIN)
 			    no_data = EAI_AGAIN;

debug log:

solving da3788198 ...
found da3788198 in https://yhetil.org/guix-patches/87ine0pjiu.fsf@fastmail.com/ ||
	https://yhetil.org/guix-patches/87d148pe57.fsf@fastmail.com/

applying [1/1] https://yhetil.org/guix-patches/87ine0pjiu.fsf@fastmail.com/
diff --git a/gnu/packages/patches/glibc-2-26-0022.patch b/gnu/packages/patches/glibc-2-26-0022.patch
new file mode 100644
index 000000000..da3788198

1:29: trailing whitespace.
 
1:30: space before tab in indent.
 	* sysdeps/posix/getaddrinfo.c (gaih_inet): Remove unreachable
1:41: space before tab in indent.
 				tmpbuf->data, tmpbuf->length,		      \
1:50: space before tab in indent.
 	goto free_and_return;						      \
1:62: space before tab in indent.
 	{								      \
Checking patch gnu/packages/patches/glibc-2-26-0022.patch...
Applied patch gnu/packages/patches/glibc-2-26-0022.patch cleanly.
warning: squelched 27 whitespace errors
warning: 32 lines add whitespace errors.

skipping https://yhetil.org/guix-patches/87d148pe57.fsf@fastmail.com/ for da3788198
index at:
100644 da37881988ffb790335d109b5dfb4b6e0fb419c2	gnu/packages/patches/glibc-2-26-0022.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).