From 312af1103e325794b4deb15940f2e7cbac8a25a9 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 17 Apr 2023 21:22:26 +0200 Subject: [PATCH] support: don't set linebuf on stderr Don't set linebuf on our stderr fallback file. Fixes #3164 --- spa/plugins/support/logger.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spa/plugins/support/logger.c b/spa/plugins/support/logger.c index 0de15c280..ca8d93f69 100644 --- a/spa/plugins/support/logger.c +++ b/spa/plugins/support/logger.c @@ -348,6 +348,9 @@ impl_init(const struct spa_handle_factory *factory, } if (this->file == NULL) this->file = stderr; + else + setlinebuf(this->file); + if (!isatty(fileno(this->file))) this->colors = false; @@ -355,8 +358,6 @@ impl_init(const struct spa_handle_factory *factory, spa_log_debug(&this->log, NAME " %p: initialized", this); - setlinebuf(this->file); - return 0; }