public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Andrea Claudi <aclaudi@redhat.com>
Cc: netdev@vger.kernel.org, Ivan Vecera <ivecera@redhat.com>,
	Petr Oros <poros@redhat.com>, David Ahern <dsahern@kernel.org>
Subject: Re: [PATCH] dpll: Fix missing notifications in monitor mode
Date: Tue, 24 Mar 2026 09:22:35 -0700	[thread overview]
Message-ID: <20260324091912.3c2eb618@phoenix.local> (raw)
In-Reply-To: <a44724170d2c5e288062a923d93c3eaccdac97e3.1773340441.git.aclaudi@redhat.com>

On Thu, 12 Mar 2026 19:35:47 +0100
Andrea Claudi <aclaudi@redhat.com> wrote:

> When running dpll monitor with output redirected to a file, notifications
> could be lost because stdout is fully buffered for file redirection instead
> of line-buffered like in interactive mode. If the program is killed or
> crashes, buffered data is lost before reaching the file.
> 
> Fix by calling fflush(stdout) after each notification to ensure immediate
> writes to the log file.
> 
> Fixes: 656cfc3ce05b ("dpll: Add dpll command")
> Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
> ---
>  dpll/dpll.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/dpll/dpll.c b/dpll/dpll.c
> index 846ad4b0..84f68f76 100644
> --- a/dpll/dpll.c
> +++ b/dpll/dpll.c
> @@ -1936,6 +1936,7 @@ static int cmd_monitor(struct dpll *dpll)
>  				       strerror(errno));
>  				break;
>  			}
> +			fflush(stdout);
>  		}
>  	}
>  

Applied but moved the fflush into the callback.

      reply	other threads:[~2026-03-24 16:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-12 18:35 [PATCH] dpll: Fix missing notifications in monitor mode Andrea Claudi
2026-03-24 16:22 ` 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=20260324091912.3c2eb618@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=aclaudi@redhat.com \
    --cc=dsahern@kernel.org \
    --cc=ivecera@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=poros@redhat.com \
    /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