[libvirt] [PATCH 1/2] util: Add helper function to build timestamp string

Osier jyang at redhat.com
Tue Nov 2 03:27:25 UTC 2010


On 11/02/2010 07:10 AM, Eric Blake wrote:
> On 10/31/2010 10:17 PM, Osier Yang wrote:
>> * src/util/util.h
>> * src/util/util.c
>> * src/libvirt_private.syms
>> ---
>>   src/libvirt_private.syms |    1 +
>>   src/util/util.c          |   20 ++++++++++++++++++++
>>   src/util/util.h          |    3 +++
>>   3 files changed, 24 insertions(+), 0 deletions(-)
>>
>> +
>> +char *virTimestamp(void) {
>
> We typically start functions with the { on the first column of a new line.
>
>> +    if (virAsprintf(&timestamp, "%s.%3d: ",
>> +                    timestr, (int) cur_time.tv_usec / 1000)<  0) {
>
> You want %03d, to ensure that you always print 3 digits of fractional
> seconds, even when<  100.
>
> ACK with those nits adjusted; I made the changes and pushed.
>

Thanks.. :)

- Osier




More information about the libvir-list mailing list