From patchwork Wed Aug 9 15:27:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 22044 Received: (qmail 54582 invoked by alias); 9 Aug 2017 15:27:22 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 54562 invoked by uid 89); 9 Aug 2017 15:27:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1281, Sometimes X-HELO: mx1.redhat.com DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7499FE8A13 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer@redhat.com Date: Wed, 09 Aug 2017 17:27:18 +0200 To: libc-alpha@sourceware.org Subject: [PATCH] nss: Use h_errno directly in getXXbyYY User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20170809152718.7E5704029813A@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) 2017-08-09 Florian Weimer * nss/getXXbyYY.c (FUNCTION_NAME): Use h_errno variable directly. (H_ERRNO_VAR, H_ERRNO_VAR_P): Adjust. diff --git a/nss/getXXbyYY.c b/nss/getXXbyYY.c index a439b81..26ee726 100644 --- a/nss/getXXbyYY.c +++ b/nss/getXXbyYY.c @@ -62,8 +62,8 @@ /* Sometimes we need to store error codes in the `h_errno' variable. */ #ifdef NEED_H_ERRNO # define H_ERRNO_PARM , int *h_errnop -# define H_ERRNO_VAR , &h_errno_tmp -# define H_ERRNO_VAR_P &h_errno_tmp +# define H_ERRNO_VAR , &h_errno +# define H_ERRNO_VAR_P &h_errno #else # define H_ERRNO_PARM # define H_ERRNO_VAR @@ -94,9 +94,6 @@ FUNCTION_NAME (ADD_PARAMS) static size_t buffer_size; static LOOKUP_TYPE resbuf; LOOKUP_TYPE *result; -#ifdef NEED_H_ERRNO - int h_errno_tmp = 0; -#endif #ifdef HANDLE_DIGITS_DOTS /* Wrap both __nss_hostname_digits_dots and the actual lookup @@ -135,7 +132,7 @@ FUNCTION_NAME (ADD_PARAMS) buffer_size, &result H_ERRNO_VAR) == ERANGE) #ifdef NEED_H_ERRNO - && h_errno_tmp == NETDB_INTERNAL + && h_errno == NETDB_INTERNAL #endif ) { @@ -165,11 +162,6 @@ done: __resolv_context_put (res_ctx); #endif -#ifdef NEED_H_ERRNO - if (h_errno_tmp != 0) - __set_h_errno (h_errno_tmp); -#endif - return result; }