Improve an error message
We were producing a misleading error message when gtk_init() fails. Fixes: #5704
This commit is contained in:
@@ -660,10 +660,7 @@ gtk_init (void)
|
||||
{
|
||||
if (!gtk_init_check ())
|
||||
{
|
||||
const char *display_name_arg;
|
||||
|
||||
display_name_arg = getenv ("DISPLAY");
|
||||
g_warning ("cannot open display: %s", display_name_arg ? display_name_arg : "");
|
||||
g_warning ("Failed to open display");
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ test_unset_display (void)
|
||||
|
||||
g_test_trap_subprocess ("/display/unset-display/subprocess/2", 0, 0);
|
||||
g_test_trap_assert_failed ();
|
||||
g_test_trap_assert_stderr ("*cannot open display*");
|
||||
g_test_trap_assert_stderr ("*Failed to open display*");
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -62,7 +62,7 @@ test_bad_display (void)
|
||||
|
||||
g_test_trap_subprocess ("/display/bad-display/subprocess/2", 0, 0);
|
||||
g_test_trap_assert_failed ();
|
||||
g_test_trap_assert_stderr ("*cannot open display*");
|
||||
g_test_trap_assert_stderr ("*Failed to open display*");
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
Reference in New Issue
Block a user