GDBusConnection: don't write to stdout

When losing the D-Bus connection, we would write to stdout about it just
before killing ourselves with SIGTERM.  We're a library, so we should
probably use stderr instead.

https://bugzilla.gnome.org/show_bug.cgi?id=721324
This commit is contained in:
Ryan Lortie 2014-01-02 01:38:07 -05:00
parent 8976175ba9
commit 51b3dd7332
2 changed files with 7 additions and 7 deletions

View File

@ -799,14 +799,14 @@ g_dbus_connection_real_closed (GDBusConnection *connection,
{
if (error != NULL)
{
g_print ("%s: Remote peer vanished with error: %s (%s, %d). Exiting.\n",
G_STRFUNC,
error->message,
g_quark_to_string (error->domain), error->code);
g_printerr ("%s: Remote peer vanished with error: %s (%s, %d). Exiting.\n",
G_STRFUNC,
error->message,
g_quark_to_string (error->domain), error->code);
}
else
{
g_print ("%s: Remote peer vanished. Exiting.\n", G_STRFUNC);
g_printerr ("%s: Remote peer vanished. Exiting.\n", G_STRFUNC);
}
raise (SIGTERM);
}

View File

@ -191,12 +191,12 @@ test_exit_on_close (gconstpointer test_data)
if (td->exit_on_close == EXPLICITLY_FALSE ||
td->who_closes == LOCAL)
{
g_test_trap_assert_stdout_unmatched (VANISHED_PATTERN);
g_test_trap_assert_stderr_unmatched (VANISHED_PATTERN);
g_test_trap_assert_passed ();
}
else
{
g_test_trap_assert_stdout (VANISHED_PATTERN);
g_test_trap_assert_stderr (VANISHED_PATTERN);
g_test_trap_assert_failed();
}
}