From: Simon Wunderlich <sw@simonwunderlich.de>
To: Jonathan Haws <Jonathan.Haws@sdl.usu.edu>
Cc: "b.a.t.m.a.n@lists.open-mesh.org" <b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [PATCH] alfred: Externalized synchronization interval
Date: Mon, 15 Aug 2016 17:09:52 +0200 [thread overview]
Message-ID: <2969743.vKtXFVpVX2@prime> (raw)
In-Reply-To: <1471273146.4556.6.camel@c00941>
[-- Attachment #1: Type: text/plain, Size: 1435 bytes --]
On Monday, August 15, 2016 2:59:05 PM CEST Jonathan Haws wrote:
> > > ALFRED_INTERVAL is now externalized via the -p option (synchronization
> > > period). If specified as option, user supplied interval is used,
> > > otherwise the default interval of ALFRED_INTERVAL is used.
> >
> > [...]
> >
> > > --- a/server.c
> > > +++ b/server.c
> > > @@ -372,7 +372,7 @@ int alfred_server(struct globals *globals)
> > >
> > >
> > > while (1) {
> > >
> > > clock_gettime(CLOCK_MONOTONIC, &now);
> > >
> > > - now.tv_sec -= ALFRED_INTERVAL;
> > > + time_diff(&now, &globals->sync_period, &now);
> >
> >
> > I believe this at least deserves a comment, or must be made more clear in
> > the
code.
>
>
> This change simply does exactly what the previous code did - subtracts
> the interval from the current time. It utilizes the existing
> time_diff() routine to account for nanoseconds.
>
> If you need me to resubmit with that language in the commit text or in a
> C comment, I can do that.
>
> Thanks!
I was staring at your code and time_diff() which was implemented for an
entirely different purpose, and concluded that you could be doing the right
thing ... ;)
But yes, please re-submit with a comment explaining that, or restructure
otherwise to make it more clear. time_diff() was written to get a difference
of two timestamps, not to subtracts times from each other, and that confused
me.
Thanks,
Simon
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
prev parent reply other threads:[~2016-08-15 15:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-28 20:43 [B.A.T.M.A.N.] [PATCH] alfred: Externalized synchronization interval Jonathan Haws
2016-08-06 16:38 ` Sven Eckelmann
2016-08-10 19:59 ` Jonathan Haws
2016-08-12 8:20 ` Simon Wunderlich
2016-08-12 8:18 ` Simon Wunderlich
2016-08-15 14:59 ` Jonathan Haws
2016-08-15 15:09 ` Simon Wunderlich [this message]
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=2969743.vKtXFVpVX2@prime \
--to=sw@simonwunderlich.de \
--cc=Jonathan.Haws@sdl.usu.edu \
--cc=b.a.t.m.a.n@lists.open-mesh.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox