summaryrefslogtreecommitdiff
path: root/src/lib/eina/eina_log.c
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2020-07-19 18:27:49 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-07-19 18:27:49 +0100
commita9710f54c1732543f57b9a44134e406b21eba93c (patch)
tree128999a4431fcc5918119db09649a9e4028cbd28 /src/lib/eina/eina_log.c
parentd6f210b3a0d78b73b678636916e98b63d94ae769 (diff)
Eina log: flush stderr on mintty-based terminals
Summary: on those terminal, stderr is never flushed, so errors messages are not displayed when, for example, the app crashes Test Plan: test program : ```#include <Eina.h> #define ERR(...) EINA_LOG_DOM_ERR(log_dom, __VA_ARGS__) int main() { int log_dom = -1; eina_init(); log_dom = eina_log_domain_register("eet", EINA_COLOR_CYAN); if (log_dom < 0) { printf("error register\n"); return 0; } ERR("an error."); while (1) { } return 0; } ``` without the patch, nothing is displayed, even after a Ctrl-C to finish the program with the patch, the error message is displayed Reviewers: raster Reviewed By: raster Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12058
Diffstat (limited to '')
-rw-r--r--src/lib/eina/eina_log.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/eina/eina_log.c b/src/lib/eina/eina_log.c
index d05aa22830..31a5871a94 100644
--- a/src/lib/eina/eina_log.c
+++ b/src/lib/eina/eina_log.c
@@ -2052,6 +2052,14 @@ eina_log_print_cb_stderr(const Eina_Log_Domain *d,
2052 vfprintf(stderr, fmt, args); 2052 vfprintf(stderr, fmt, args);
2053 putc('\n', stderr); 2053 putc('\n', stderr);
2054 DISPLAY_BACKTRACE(stderr, level); 2054 DISPLAY_BACKTRACE(stderr, level);
2055# ifdef _WIN32
2056 /*
2057 * NOTE: when using mintty-base terminals (like MSYS2, or cygwin one),
2058 * stderr is not flushed, so we force flush in this case.
2059 */
2060 if (!_eina_log_win32_is_console)
2061 fflush(stderr);
2062# endif
2055#else 2063#else
2056 (void) d; 2064 (void) d;
2057 (void) level; 2065 (void) level;