From b78c854700a9486766880860d6f121ffee51c78e Mon Sep 17 00:00:00 2001 From: o9000 Date: Fri, 17 Apr 2015 20:31:28 +0000 Subject: [PATCH] Flush stdout/stderr after newline git-svn-id: http://tint2.googlecode.com/svn/trunk@760 121b4492-b84c-0410-8b4c-0d4edfb3f3cc --- src/launcher/icon-theme-common.c | 1 - src/tint.c | 4 ++++ src/tint2conf/main.c | 1 - src/tint2conf/properties_rw.c | 1 - 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/launcher/icon-theme-common.c b/src/launcher/icon-theme-common.c index 17dc16c..331b973 100644 --- a/src/launcher/icon-theme-common.c +++ b/src/launcher/icon-theme-common.c @@ -394,7 +394,6 @@ void load_themes_helper(const char *name, GSList **themes, GSList **queued) free(name); } fprintf(stderr, "\n"); - fflush(stderr); // Free the queue GSList *l; diff --git a/src/tint.c b/src/tint.c index 607692f..7890972 100644 --- a/src/tint.c +++ b/src/tint.c @@ -1082,6 +1082,10 @@ int main (int argc, char *argv[]) struct timeval* timeout; int hidden_dnd = 0; + // Make stdout/stderr flush after a newline (for some reason they don't even if tint2 is started from a terminal) + setlinebuf(stdout); + setlinebuf(stderr); + start: init (argc, argv); diff --git a/src/tint2conf/main.c b/src/tint2conf/main.c index dde8eff..c64a5b5 100644 --- a/src/tint2conf/main.c +++ b/src/tint2conf/main.c @@ -433,7 +433,6 @@ void menuApply() } // Write config file printf("Writing %s to %s\n", g_default_theme, g_path_config); - fflush(stdout); copy_file(g_default_theme, g_path_config); // Restart panel int unused = system("killall -SIGUSR1 tint2"); diff --git a/src/tint2conf/properties_rw.c b/src/tint2conf/properties_rw.c index f61173d..bc95dc3 100644 --- a/src/tint2conf/properties_rw.c +++ b/src/tint2conf/properties_rw.c @@ -517,7 +517,6 @@ void config_write_tooltip(FILE *fp) void config_save_file(const char *path) { printf("config_save_file : %s\n", path); - fflush(stdout); FILE *fp; if ((fp = fopen(path, "wt")) == NULL)