From c847b3c704fb1d915f74a9c9df725a76f4c60d9c Mon Sep 17 00:00:00 2001 From: Andreas Bergmeier Date: Wed, 6 Sep 2017 21:49:50 +0200 Subject: demos: Print XCB errors to stderr Printing to stdout is weird. Change-Id: If53e8708b853989ae8a9ea61fa4d57f27b24b45c --- demos/vulkaninfo.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/demos/vulkaninfo.c b/demos/vulkaninfo.c index 77c5f383..cfd0e0c9 100644 --- a/demos/vulkaninfo.c +++ b/demos/vulkaninfo.c @@ -926,17 +926,12 @@ static void AppCreateXcbWindow(struct AppInstance *inst) { xcb_screen_iterator_t iter; int scr; + // API guarantees non-null xcb_connection inst->xcb_connection = xcb_connect(NULL, &scr); - if (inst->xcb_connection == NULL) { - printf("XCB failed to connect to the X server.\nExiting ...\n"); - fflush(stdout); - exit(1); - } - int conn_error = xcb_connection_has_error(inst->xcb_connection); if (conn_error) { - printf("XCB failed to connect to the X server due to error:%d.\nExiting ...\n", conn_error); - fflush(stdout); + fprintf(stderr, "XCB failed to connect to the X server due to error:%d.\nExiting ...\n", conn_error); + fflush(stderr); exit(1); } -- cgit v1.2.3