|
From: | Mao Zhongyi |
Subject: | Re: [Qemu-devel] [PATCH v5 3/4] net/net: Convert parse_host_port() to Error |
Date: | Wed, 28 Jun 2017 21:01:41 +0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 06/28/2017 06:56 PM, Markus Armbruster wrote:
Paolo Bonzini <address@hidden> 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
[Prev in Thread] | Current Thread | [Next in Thread] |