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>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
break;
}
+ fflush(stdout);
return ret;
}