diff options
-rw-r--r-- | daemon/gkd-main.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/daemon/gkd-main.c b/daemon/gkd-main.c index 57d3288e..731d205f 100644 --- a/daemon/gkd-main.c +++ b/daemon/gkd-main.c @@ -567,6 +567,7 @@ print_environment (pid_t pid) printf ("%s\n", *env); if (pid) printf ("GNOME_KEYRING_PID=%d\n", (gint)pid); + fflush (stdout); } static gboolean @@ -883,6 +884,18 @@ static gboolean on_idle_initialize (gpointer data) { gkr_daemon_initialize_steps (run_components); + + /* + * Close stdout and so that the caller knows that we're + * all initialized, (when run in foreground mode). + * + * However since some logging goes to stdout, redirect that + * to stderr. We don't want the caller confusing that with + * valid output anyway. + */ + if (dup2 (2, 1) < 1) + g_warning ("couldn't redirect stdout to stderr"); + return FALSE; /* don't run again */ } |