summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2010-09-21 00:30:46 -0400
committerMatthias Clasen <mclasen@redhat.com>2010-09-21 00:30:46 -0400
commit93e203e06769ccae494fc67809b9b4ee855f5b05 (patch)
tree63eb26d745197529ea6bd5e849a6b240b6c4f315 /gdk
parente0aa12eb0ab8d20a2bc9de7d89c779d3566ee669 (diff)
downloadgtk+-93e203e06769ccae494fc67809b9b4ee855f5b05.tar.gz
Use g_warning() for X errors and X IO errors
Currently fprintf(stderr, ...) is used for X error and X IO errors (unless compiled with debugging, in which case g_error() is used for X errors.) But if an application is redirecting log messages, we really want X errors to appear in that same log, so it's better to use a g_logv() variant. Though g_warning() isn't really appropriate for "lost connection to the server", G_LOG_LEVEL_INFO isn't part of the "prefixed log levels" so will produce output without the application name and PID. https://bugzilla.gnome.org/show_bug.cgi?id=630216
Diffstat (limited to 'gdk')
-rw-r--r--gdk/x11/gdkdisplay-x11.c2
-rw-r--r--gdk/x11/gdkmain-x11.c19
2 files changed, 10 insertions, 11 deletions
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index db8175cb1b..f15da8b80c 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -2751,7 +2751,7 @@ _gdk_x11_display_error_event (GdkDisplay *display,
#ifdef G_ENABLE_DEBUG
g_error ("%s", msg);
#else /* !G_ENABLE_DEBUG */
- g_fprintf (stderr, "%s\n", msg);
+ g_warning ("%s\n", msg);
exit (1);
#endif /* G_ENABLE_DEBUG */
diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c
index ca20f97304..c71e189aa0 100644
--- a/gdk/x11/gdkmain-x11.c
+++ b/gdk/x11/gdkmain-x11.c
@@ -318,19 +318,18 @@ gdk_x_io_error (Display *display)
*/
if (errno == EPIPE)
{
- g_fprintf (stderr,
- "The application '%s' lost its connection to the display %s;\n"
- "most likely the X server was shut down or you killed/destroyed\n"
- "the application.\n",
- g_get_prgname (),
- display ? DisplayString (display) : gdk_get_display_arg_name ());
+ g_warning ("The application '%s' lost its connection to the display %s;\n"
+ "most likely the X server was shut down or you killed/destroyed\n"
+ "the application.\n",
+ g_get_prgname (),
+ display ? DisplayString (display) : gdk_get_display_arg_name ());
}
else
{
- g_fprintf (stderr, "%s: Fatal IO error %d (%s) on X server %s.\n",
- g_get_prgname (),
- errno, g_strerror (errno),
- display ? DisplayString (display) : gdk_get_display_arg_name ());
+ g_warning ("%s: Fatal IO error %d (%s) on X server %s.\n",
+ g_get_prgname (),
+ errno, g_strerror (errno),
+ display ? DisplayString (display) : gdk_get_display_arg_name ());
}
exit(1);