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

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



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

Attachment: signature.asc
Description: OpenPGP digital signature


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