From: Richard Weinberger <richard@nod.at>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
netfilter-devel@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, rostedt@goodmis.org,
pablo@netfilter.org, basti@b-bl.de
Subject: Re: [PATCH 2/2] Netfilter: xt_LOG: Add timestamp support
Date: Wed, 15 Feb 2012 20:39:40 +0100 [thread overview]
Message-ID: <4F3C09FC.2020800@nod.at> (raw)
In-Reply-To: <alpine.LNX.2.01.1202151815270.15357@frira.zrqbmnf.qr>
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
next prev parent reply other threads:[~2012-02-15 19:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-15 13:55 [PATCH 1/2] Netfilter: xt_LOG: Implement ring buffer support Richard Weinberger
2012-02-15 13:55 ` [PATCH 2/2] Netfilter: xt_LOG: Add timestamp support Richard Weinberger
2012-02-15 14:01 ` Eric Dumazet
2012-02-15 14:01 ` Eric Dumazet
2012-02-15 14:07 ` Richard Weinberger
2012-02-15 14:07 ` Richard Weinberger
2012-02-15 17:16 ` Jan Engelhardt
2012-02-15 19:39 ` Richard Weinberger [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-02-15 23:27 [PATCH 1/2] Netfilter: xt_LOG: Implement ring buffer support Richard Weinberger
2012-02-15 23:28 ` [PATCH 2/2] Netfilter: xt_LOG: Add timestamp support Richard Weinberger
2012-02-14 23:36 [PATCH 1/2] Netfilter: xt_LOG: Implement ring buffer support Richard Weinberger
2012-02-14 23:36 ` [PATCH 2/2] Netfilter: xt_LOG: Add timestamp support Richard Weinberger
2012-02-15 4:56 ` Eric Dumazet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F3C09FC.2020800@nod.at \
--to=richard@nod.at \
--cc=basti@b-bl.de \
--cc=eric.dumazet@gmail.com \
--cc=jengelh@medozas.de \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.