[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 3/4] net/net: Convert parse_host_port() to Er
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v5 3/4] net/net: Convert parse_host_port() to Error |
Date: |
Wed, 28 Jun 2017 12:56:28 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
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().
[Qemu-devel] [PATCH v5 2/4] net/socket: Convert error message to Error, Mao Zhongyi, 2017/06/26
[Qemu-devel] [PATCH v5 4/4] net/socket: Improve -net socket error reporting, Mao Zhongyi, 2017/06/26