[{"id":1763538,"web_url":"http://patchwork.ozlabs.org/comment/1763538/","msgid":"<7698c787-cb87-e99b-c260-895ef65eb52b@linaro.org>","list_archive_url":null,"date":"2017-09-05T17:54:52","subject":"Re: [PATCH] support_format_hostent: Add more error information for\n\tNETDB_INTERNAL","submitter":{"id":66065,"url":"http://patchwork.ozlabs.org/api/people/66065/","name":"Adhemerval Zanella Netto","email":"adhemerval.zanella@linaro.org"},"content":"On 04/09/2017 14:32, Florian Weimer wrote:\n> 2017-09-04  Florian Weimer  <fweimer@redhat.com>\n> \n> \t* support/support_format_hostent.c (support_format_hostent): Add\n> \tmore error information for NETDB_INTERNAL.\n\nLGTM.\n\n> \n> diff --git a/support/support_format_hostent.c b/support/support_format_hostent.c\n> index 5b5f26082e..88c85ec1f1 100644\n> --- a/support/support_format_hostent.c\n> +++ b/support/support_format_hostent.c\n> @@ -19,6 +19,7 @@\n>  #include <support/format_nss.h>\n>  \n>  #include <arpa/inet.h>\n> +#include <errno.h>\n>  #include <stdio.h>\n>  #include <support/support.h>\n>  #include <support/xmemstream.h>\n> @@ -41,10 +42,15 @@ support_format_hostent (struct hostent *h)\n>  {\n>    if (h == NULL)\n>      {\n> -      char *value = support_format_herrno (h_errno);\n> -      char *result = xasprintf (\"error: %s\\n\", value);\n> -      free (value);\n> -      return result;\n> +      if (h_errno == NETDB_INTERNAL)\n> +        return xasprintf (\"error: NETDB_INTERNAL (errno %d, %m)\\n\", errno);\n> +      else\n> +        {\n> +          char *value = support_format_herrno (h_errno);\n> +          char *result = xasprintf (\"error: %s\\n\", value);\n> +          free (value);\n> +          return result;\n> +        }\n>      }\n>  \n>    struct xmemstream mem;\n>","headers":{"Return-Path":"<libc-alpha-return-84200-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-84200-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"UVIyLMTi\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xmvWH5BP2z9sNc\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  6 Sep 2017 03:55:07 +1000 (AEST)","(qmail 64202 invoked by alias); 5 Sep 2017 17:55:02 -0000","(qmail 64191 invoked by uid 89); 5 Sep 2017 17:55:02 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:subject:to:references:from:message-id:date\n\t:mime-version:in-reply-to:content-type\n\t:content-transfer-encoding; q=dns; s=default; b=Ty7uxL0bEm1VWiu1\n\tTc4p2JU/gCxs21MjqXezUkqjh/8ecEeIapace6KzCn7Xa93BMCfx8LkTyK3UmQjF\n\takfkt1PMbCRypVq/4NmEzzWSgUL2RFrsYqG2jiNqHTuAdKZ30ogzoVB4FGuyOdM2\n\teXByewstrB5als/CKnXBy9fXS3Y=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:subject:to:references:from:message-id:date\n\t:mime-version:in-reply-to:content-type\n\t:content-transfer-encoding; s=default; bh=55k3o735Doa5bBhdoyp75o\n\tkXF1Y=; b=UVIyLMTiDPUyz8a16GBIGBY3vM1ZPLGWoNgab7IpO8wrZmZwfAIqQm\n\tQOgxakkvGID4s5Nw9Zv61P2V71vrrlWcp75DFp610Lg3IeAfcH0UJ3OdW0ePKmra\n\tNTzAyM9su2xNnQ0rXt5klwFcu+0Q6NERIt6ULBT5PPW53+rA2hdGc=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0,\n\tGIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=","X-HELO":"mail-qk0-f178.google.com","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:subject:to:references:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=EGNrNG/R41uVjQtC72EcmNKKncy1wdX6sfFlll39pe8=;\n\tb=P5M6T6vgCtyGzZidAnrgbzGk0LYTUOPa0C4kIJx5ow6RNb12Z3A0hgxAg2VoAUvlYf\n\tKFByiyKzsV1tXKLKbn54fvpJPgYWVQwyVelio4b4BkfLKFZLIb2ICBwDwBmYa+2tgcB8\n\t6pujpOhh3izF4DhZrgvDUs5gHdj3Sca37TBCJH6zIizzPaSH9iEj3+vAR/bPWP2jEPx9\n\tJzZAJ+rl4fKEaM9numqeG7hxz5Ztw4BkSYn7AgaPTJAooPZzgiAgNwGPQr0ZKexaWCLq\n\tiMx7OJYbLPbbwaP2GAIOALOtyS3ZBgiFKSGPzfhbo+ipA46U/zb3Ck7b0+T1/YL9FWY1\n\taZYw==","X-Gm-Message-State":"AHPjjUgTswXROiFtGmYLBOJLpEqGbPkRA4rclJIHXbOCy+c8Nlc6i7Id\n\tY18Rp0C3vrGAyseNngn43w==","X-Google-Smtp-Source":"ADKCNb6FAq9+6YWsX644TYn8bOREOCInWfDWuic76SDrU8bUtdtTe8jIiRKsK9eRMj3th0h8X6uaog==","X-Received":"by 10.55.161.85 with SMTP id k82mr6645191qke.156.1504634095432; \n\tTue, 05 Sep 2017 10:54:55 -0700 (PDT)","Subject":"Re: [PATCH] support_format_hostent: Add more error information for\n\tNETDB_INTERNAL","To":"libc-alpha@sourceware.org","References":"<20170904173203.A176E439942E3@oldenburg.str.redhat.com>","From":"Adhemerval Zanella <adhemerval.zanella@linaro.org>","Message-ID":"<7698c787-cb87-e99b-c260-895ef65eb52b@linaro.org>","Date":"Tue, 5 Sep 2017 14:54:52 -0300","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170904173203.A176E439942E3@oldenburg.str.redhat.com>","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"7bit"}}]