From: Timo Kokkonen Date: Tue, 9 Mar 2021 13:35:49 +0000 (+0200) Subject: bmed: Flush stdout after writing logs X-Git-Url: http://git.itanic.dy.fi/?p=BME280_driver;a=commitdiff_plain;h=880166825cbf5397eeb31673f99c925f3e72a8ab 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 --- 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++)