[libvirt] [PATCH 09/10] Ignore error returns for virBufferTrim().

Eric Blake eblake at redhat.com
Fri Jan 4 17:50:59 UTC 2013


On 01/03/2013 12:39 PM, Daniel P. Berrange wrote:
> On Thu, Jan 03, 2013 at 02:16:21PM -0500, John Ferlan wrote:
>> ---
>>  tools/virsh.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>

> 
> I must say I don't see the point in the return value
> for virBufferTrim. I think I'd recommend turning it
> into a 'void' function

Ah, but virbuftest.c exposes why a return value can be useful - it lets
you know how much was trimmed, or if trimming was prevented because the
string didn't end with the suffix you expect.  Making the function
'void' would require rewriting the test, and losing out on that
functionality.  Just because all current callers outside of the
testsuite don't use that functionality (virnetsshsession.c, virsh.c)
doesn't mean we should necessarily get rid of it - is there any
alternative way to shut up Coverity to say that we can safely ignore
this return value without having to mark up all the callers?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130104/9ab0eddc/attachment-0001.sig>


More information about the libvir-list mailing list