From 880166825cbf5397eeb31673f99c925f3e72a8ab Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Tue, 9 Mar 2021 15:35:49 +0200 Subject: [PATCH] bmed: Flush stdout after writing logs This makes it easier to follow the logs when the daemon doesn't have an interactive tty for its output. Signed-off-by: Timo Kokkonen --- bmed.c | 1 + 1 file changed, 1 insertion(+) diff --git a/bmed.c b/bmed.c index a766cde..6970aa1 100644 --- a/bmed.c +++ b/bmed.c @@ -478,6 +478,7 @@ static int stream_sensor_data_forced_mode(struct bme280 *bme) printf("%s %0.4lf deg C, %0.4lf hPa, %0.4lf%%, dp: %.3f C\n", s, temp, press, hum, dew); + fflush(stdout); pthread_mutex_lock(&bme->lock); for (i = 0; i < ARRAY_SIZE(bme->data) - 1; i++) -- 2.45.0