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

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



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


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