From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQCba-0006Ve-PB for qemu-devel@nongnu.org; Wed, 28 Jun 2017 09:02:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dQCbU-00081U-Vh for qemu-devel@nongnu.org; Wed, 28 Jun 2017 09:02:02 -0400 Received: from [59.151.112.132] (port=1830 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQCbU-0007yv-IP for qemu-devel@nongnu.org; Wed, 28 Jun 2017 09:01:56 -0400 References: <87tw31luv3.fsf@dusky.pond.sub.org> <87vangd5hh.fsf@dusky.pond.sub.org> <87efu4pehv.fsf@dusky.pond.sub.org> From: Mao Zhongyi Message-ID: <8700532c-1982-6a61-d6a2-5a6cb0e7ae7e@cn.fujitsu.com> Date: Wed, 28 Jun 2017 21:01:41 +0800 MIME-Version: 1.0 In-Reply-To: <87efu4pehv.fsf@dusky.pond.sub.org> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v5 3/4] net/net: Convert parse_host_port() to Error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , Paolo Bonzini Cc: jasowang@redhat.com, qemu-devel@nongnu.org, kraxel@redhat.com On 06/28/2017 06:56 PM, Markus Armbruster wrote: > Paolo Bonzini writes: > >> On 28/06/2017 07:51, Markus Armbruster wrote: >>>> The gethostbyname() return a null pointer if an error occurs, and the h_errno >>>> variable holds an error number. herror() and hstrerror() can prints the error >>>> message associated with the current value of h_errno, but hstrerror() returns >>>> the string type is good for passing the error message to Error. So I'd prefer >>>> the hstrerror. >>>> >>>> As for the portability of hstrerror(), sorry, I'm also not sure, but in this >>>> case I tested, it's OK. so I want to use hstrerror() for a while, if there are >>>> any problem that can be fixed later. Do you think it can be done? >>> >>> Standard first portability question: does Windows provide it? >> >> Nope. But it does have gai_strerror. > > Let's go with the generic error message I suggested, and leave adding > detail to the patch that converts to getaddrinfo(). OK, I will fix it right away. Thanks, Mao