On 05/19/2014 10:57 AM, Markus Armbruster wrote: > Using error_is_set(ERRP) to find out whether a function failed is > either wrong, fragile, or unnecessarily opaque. It's wrong when ERRP > may be null, because errors go undetected when it is. It's fragile > when proving ERRP non-null involves a non-local argument. Else, it's > unnecessarily opaque (see commit 84d18f0). > > The error_is_set(errp) in qemu_chr_new_from_opts() is merely fragile, > because the callers never pass a null errp argument. > > Make the code more robust and more obviously correct: receive the > error in a local variable, then propagate it through the parameter. > > Signed-off-by: Markus Armbruster <arm...@redhat.com> > --- > qemu-char.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-)
Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature