test/x11comp: server writes \n to displayfd

Signed-off-by: Ran Benita <ran234@gmail.com>
master
Ran Benita 2014-08-18 19:47:10 +03:00
parent 4df720b464
commit a95c4e83e4
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}