Re: [libvirt] [PATCH 1/3] virterror: Make SetError work if no previous error was set
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 >> --- >> 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@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 1/3] virterror: Make SetError work if no previous error was set
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 > --- > 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 -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 1/3] virterror: Make SetError work if no previous error was set
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 --- 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; -- 1.6.5.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list