diff options
| author | Andreas Bergmeier <abergmeier@gmx.net> | 2017-09-06 21:49:50 +0200 |
|---|---|---|
| committer | Mark Lobodzinski <mark@lunarg.com> | 2017-09-13 08:47:58 -0600 |
| commit | c847b3c704fb1d915f74a9c9df725a76f4c60d9c (patch) | |
| tree | f18f5ac1296d2c9061ff212d7fda519818ef4b2f | |
| parent | 1b508335c041e82bf1ec375f383a3e5a93c803cf (diff) | |
| download | usermoji-c847b3c704fb1d915f74a9c9df725a76f4c60d9c.tar.xz | |
demos: Print XCB errors to stderr
Printing to stdout is weird.
Change-Id: If53e8708b853989ae8a9ea61fa4d57f27b24b45c
| -rw-r--r-- | demos/vulkaninfo.c | 11 |
1 files 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); } |
