Re: [PATCH] sexpr: Improve serialization error reporting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011/5/27 Daniel P. Berrange <berrange@xxxxxxxxxx>:
> On Fri, May 27, 2011 at 03:09:36PM +0200, Matthias Bolte wrote:
>> ---
>> Âsrc/util/sexpr.c | Â 12 +++++-------
>> Â1 files changed, 5 insertions(+), 7 deletions(-)
>>
>> diff --git a/src/util/sexpr.c b/src/util/sexpr.c
>> index d8d4c2d..0e30087 100644
>> --- a/src/util/sexpr.c
>> +++ b/src/util/sexpr.c
>> @@ -215,7 +215,7 @@ sexpr2string(const struct sexpr *sexpr, virBufferPtr buffer)
>> Â Â Â Â ÂvirBufferAddChar(buffer, '(');
>>
>> Â Â Â Â Âif (sexpr2string(sexpr->u.s.car, buffer) < 0)
>> - Â Â Â Â Â Âgoto error;
>> + Â Â Â Â Â Âreturn -1;
>>
>> Â Â Â Â Âwhile (sexpr->u.s.cdr->kind != SEXPR_NIL) {
>> Â Â Â Â Â Â Âsexpr = sexpr->u.s.cdr;
>> @@ -223,7 +223,7 @@ sexpr2string(const struct sexpr *sexpr, virBufferPtr buffer)
>> Â Â Â Â Â Â ÂvirBufferAddChar(buffer, ' ');
>>
>> Â Â Â Â Â Â Âif (sexpr2string(sexpr->u.s.car, buffer) < 0)
>> - Â Â Â Â Â Â Â Âgoto error;
>> + Â Â Â Â Â Â Â Âreturn -1;
>> Â Â Â Â Â}
>>
>> Â Â Â Â ÂvirBufferAddChar(buffer, ')');
>> @@ -241,14 +241,12 @@ sexpr2string(const struct sexpr *sexpr, virBufferPtr buffer)
>> Â Â Â Â ÂvirBufferAddLit(buffer, "()");
>> Â Â Â Â Âbreak;
>> Â Â Âdefault:
>> - Â Â Â Âgoto error;
>> + Â Â Â ÂvirSexprError(VIR_ERR_SEXPR_SERIAL,
>> + Â Â Â Â Â Â Â Â Â Â Â_("unknown s-expression kind %d"), sexpr->kind);
>> + Â Â Â Âreturn -1;
>> Â Â Â}
>>
>> Â Â Âreturn 0;
>> -
>> - Âerror:
>> - Â ÂvirSexprError(VIR_ERR_SEXPR_SERIAL, NULL);
>> - Â Âreturn -1;
>> Â}
>>
>> Â#define IS_SPACE(c) ((c == 0x20) || (c == 0x9) || (c == 0xD) || (c == 0xA))
>
>
> ACK
>
>
> Daniel

Thanks, pushed.

Matthias

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]