lkml.org 
[lkml]   [2012]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] Netfilter: xt_LOG: Add timestamp support
Am 15.02.2012 18:16, schrieb Jan Engelhardt:
>
> On Wednesday 2012-02-15 15:07, Richard Weinberger wrote:
>>>> + struct timespec tv;
>>>> + unsigned int msec;
>>>> +
>>>> + getnstimeofday(&tv);
>>>> + msec = tv.tv_nsec / NSEC_PER_MSEC;
>>>> + sb_add(m, "TIMESTAMP=%li.%03li ", tv.tv_sec, msec);
>>>
>>> Since you want to use this temp variable "unsigned int msec" (I have no
>>> idea why...), you must change printf format accordingly : %03u instead
>>> of %03li
>>
>> *grml*.
>> I'll remove the temp variable and use %03u.
>
> Why not just print the nsecs directly (with %09 of course)?

I don't think that a nanosecond resolution is useful.

Thanks,
//richard


\
 
 \ /
  Last update: 2012-02-15 20:41    [W:0.096 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site