public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemming@brocade.com>
To: Phil Sutter <phil@nwl.cc>
Cc: <netdev@vger.kernel.org>
Subject: Re: [iproute PATCH] ifstat, nstat: fix daemon mode
Date: Sun, 6 Mar 2016 12:50:51 -0800	[thread overview]
Message-ID: <20160306125051.5d9e3425@xeon-e3> (raw)
In-Reply-To: <1456934187-4843-1-git-send-email-phil@nwl.cc>

On Wed,  2 Mar 2016 16:56:27 +0100
Phil Sutter <phil@nwl.cc> wrote:

> Since the relevant code (and it's bugs) is identical in both files, fix
> them in one go. This patch fixes multiple issues:
> 
> * Using 'int' for the 'tdiff' variable does not suffice on 64bit
>   systems, the assigned initial time difference makes it wrap and
>   contain a negative value afterwards. Instead use the more appropriate
>   'time_t' type.
> 
> * As far as I understood the code, poll() is supposed to time out just
>   at the right time to trigger update_db() in the configured interval.
>   Therefore it's timeout must be set to the desired interval *minus* the
>   time that has already passed since then.
> 
> * With the last change to the algorithm in place, it does not make sense
>   to call update_db() before returning data to the connected client.
>   Actually, it never does otherwise we could skip the periodic updates
>   in the first place.
> 
> Signed-off-by: Phil Sutter <phil@nwl.cc>

Applied

      reply	other threads:[~2016-03-06 20:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-02 15:56 [iproute PATCH] ifstat, nstat: fix daemon mode Phil Sutter
2016-03-06 20:50 ` Stephen Hemminger [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=20160306125051.5d9e3425@xeon-e3 \
    --to=shemming@brocade.com \
    --cc=netdev@vger.kernel.org \
    --cc=phil@nwl.cc \
    /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