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 --- 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); } } -- 2.53.0