diff --git a/glnx-console.c b/glnx-console.c index 1cb3a49715d97d236e171cce60a48ac15a1657ea..8813074504912789e5792d933ecab0b455d52d11 100644 --- a/glnx-console.c +++ b/glnx-console.c @@ -46,8 +46,8 @@ static gboolean locked; static guint64 last_update_ms; /* monotonic time in millis we last updated */ -static gboolean -stdout_is_tty (void) +gboolean +glnx_stdout_is_tty (void) { static gsize initialized = 0; static gboolean stdout_is_tty_v; @@ -156,7 +156,7 @@ glnx_console_lock (GLnxConsoleRef *console) g_return_if_fail (!locked); g_return_if_fail (!console->locked); - console->is_tty = stdout_is_tty (); + console->is_tty = glnx_stdout_is_tty (); locked = console->locked = TRUE; @@ -199,7 +199,7 @@ text_percent_internal (const char *text, if (percentage != 100) { const guint64 diff_ms = current_ms - last_update_ms; - if (stdout_is_tty ()) + if (glnx_stdout_is_tty ()) { if (diff_ms < (1000/MAX_TTY_UPDATE_HZ)) return; @@ -224,7 +224,7 @@ text_percent_internal (const char *text, const guint input_textlen = text ? strlen (text) : 0; - if (!stdout_is_tty ()) + if (!glnx_stdout_is_tty ()) { if (text) fprintf (stdout, "%s", text); diff --git a/glnx-console.h b/glnx-console.h index 108dc4076555b9445b26abf79265dd9d29d1bfc5..d853a80c69121b4ad7e600d7f591f539b1b94c03 100644 --- a/glnx-console.h +++ b/glnx-console.h @@ -31,6 +31,8 @@ struct GLnxConsoleRef { typedef struct GLnxConsoleRef GLnxConsoleRef; +gboolean glnx_stdout_is_tty (void); + void glnx_console_lock (GLnxConsoleRef *ref); void glnx_console_text (const char *text);