[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 15/16] os-posix: cleanup: Replace perror with er
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 15/16] os-posix: cleanup: Replace perror with error_report |
Date: |
Tue, 24 Apr 2018 10:40:47 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
On 04/24/2018 10:18 AM, Daniel P. Berrangé wrote:
>> - static void vreport(report_type type, const char *fmt, va_list ap)
>> + static void vreport(report_type type, int errnoval, const char *fmt,
>> va_list ap)
>> ...
>> + if (errnoval >= 0) {
>> + error_printf(": %s", strerror(errnoval);
>> + }
>>
>> and then add both
>> error_report_errno
>> error_vreport_errno
>> with the obvious semantics.
>
> That would be nice, because then we can make these two functions actually
> use strerror_r() instead of strerror(), for thread safety on all platforms.
Except that strerror_r() is a bear to use portably, given that glibc's
default declaration differs from the POSIX requirement (you can force
glibc to give you the POSIX version, but doing so causes you to lose
access to many other useful extensions). It's rather telling that 'git
grep strerror_r' currently comes up empty.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 10/16] os-posix: Provide new -runas <uid>:<gid> facility, (continued)
- [Qemu-devel] [PATCH 10/16] os-posix: Provide new -runas <uid>:<gid> facility, Ian Jackson, 2018/04/19
- [Qemu-devel] [PATCH 11/16] xen: Use newly added dmops for mapping VGA memory, Ian Jackson, 2018/04/19
- [Qemu-devel] [PATCH 02/16] AccelClass: Introduce accel_setup_post, Ian Jackson, 2018/04/19
- [Qemu-devel] [PATCH 12/16] xen: Remove now-obsolete xen_xc_domain_add_to_physmap, Ian Jackson, 2018/04/19
- [Qemu-devel] [PATCH 15/16] os-posix: cleanup: Replace perror with error_report, Ian Jackson, 2018/04/19
- Re: [Qemu-devel] [PATCH 15/16] os-posix: cleanup: Replace perror with error_report, Markus Armbruster, 2018/04/24
[Qemu-devel] [PATCH 16/16] configure: do_compiler: Dump some extra info under bash, Ian Jackson, 2018/04/19