Re: [PATCH 3/4] virnetdevbandwidthtest: Introduce mocking

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

 



On 01/27/2014 04:17 AM, Michal Privoznik wrote:

>>
>> This could be simplified with virFileWriteStr().
> 
> Not really. I need to append to the file, while virFileWriteStr() truncate the file prior to writing to it. Always.

That sounds like something that could be fixed, though, if it is a
common enough pattern to want to append rather than truncate.

> 
>>
>>> + +    if (VIR_STRDUP_QUIET(outfile, OUTFILETEMPLATE) < 0) { + 
>>> fprintf(stderr, "Out of memory\n"); +        abort(); +    } + + if
>>> (!mktemp(outfile)) {
>>
>> I'd prefer mkstemp(), for safety.
>>
> 
> Uh.. okay.
> 
> Michal
> 
> 

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

Attachment: signature.asc
Description: OpenPGP digital signature

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