From a95c4e83e41eebce45d43d23b5c179d0f2a263ea Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 18 Aug 2014 19:47:10 +0300 Subject: [PATCH] test/x11comp: server writes \n to displayfd Signed-off-by: Ran Benita --- test/x11comp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/x11comp.c b/test/x11comp.c index a8c27fe..c63c4cc 100644 --- a/test/x11comp.c +++ b/test/x11comp.c @@ -81,12 +81,14 @@ main(void) display[0] = ':'; ret = read(pipefds[0], display + 1, sizeof(display) - 1); assert(ret > 0 && 1 + ret < sizeof(display) - 1); + if (display[ret] == '\n') + display[ret] = '\0'; display[1 + ret] = '\0'; close(pipefds[0]); close(pipefds[1]); conn = xcb_connect(display, NULL); - if (!conn || xcb_connection_has_error(conn)) { + if (xcb_connection_has_error(conn)) { ret = SKIP_TEST; goto err_xvfd; }