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@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to