Re: [libvirt] [PATCH 1/3] virterror: Make SetError work if no previous error was set

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

 



On 02/18/2010 07:45 AM, Daniel P. Berrange wrote:
> On Tue, Feb 16, 2010 at 02:37:00PM -0500, Cole Robinson wrote:
>> virGetLastError returns NULL if no error has been set, not on
>> allocation error like virSetError assumed. Use virLastErrorObject
>> instead. This fixes virSetError when no error is currently stored.
>>
>> Signed-off-by: Cole Robinson <crobinso@xxxxxxxxxx>
>> ---
>>  src/util/virterror.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/util/virterror.c b/src/util/virterror.c
>> index bbf5021..cbd0ca8 100644
>> --- a/src/util/virterror.c
>> +++ b/src/util/virterror.c
>> @@ -304,7 +304,7 @@ int
>>  virSetError(virErrorPtr newerr)
>>  {
>>      virErrorPtr err;
>> -    err = virGetLastError();
>> +    err = virLastErrorObject();
>>      if (!err)
>>          return -1;
>>  
>> -- 
> 
> ACK
> 
> Daniel

Thanks, I've pushed these 3 now.

- Cole

--
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]