Report gettimeofday() for comparison. seclog
authorEmil Mikulic <emikulic@gmail.com>
Thu, 7 Apr 2011 14:09:09 +0000 (00:09 +1000)
committerEmil Mikulic <emikulic@gmail.com>
Thu, 7 Apr 2011 14:09:09 +0000 (00:09 +1000)
seclog.c

index 94fa22c..98a5a5a 100644 (file)
--- a/seclog.c
+++ b/seclog.c
@@ -68,10 +68,14 @@ seclog_emit(void)
 
   if (fd != -1) {
     struct str *buf = str_make();
+    struct timeval tv;
     char *s;
     size_t len;
-    str_appendf(buf, "%s|%u|%qu|%qu|%qu|%qu\n",
+    gettimeofday(&tv, NULL);
+    str_appendf(buf, "%s|%u|%qu.%qu|%qu|%qu|%qu|%qu\n",
         fmt_date(today_time), (unsigned int)today_time,
+        (uint64_t)tv.tv_sec,
+        (uint64_t)tv.tv_usec,
         bytes_in, bytes_out, pkts_in, pkts_out);
     str_extract(buf, &len, &s);