Skip to content

Commit

Permalink
Fix the logic for opening the non-abstract socket (again)
Browse files Browse the repository at this point in the history
The change in commit be1bc97 misunderstood the intention of
opening the non-abstract socket by assuming it was a fallback. In fact
the code should be opening both types of socket. It later passes both
of them down to XWayland by an event in the Wayland protocol. This was
causing it to pass down a bogus file descriptor for the non-abstract
socket which somehow made it call accept on the TTY device which would
make the X server get stuck in an infinite loop if any input came in
on the console.
  • Loading branch information
bpeel committed Jul 17, 2013
1 parent a972efe commit 4fa2b36
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions src/clayland.c
Expand Up @@ -1084,26 +1084,23 @@ start_xwayland (ClaylandCompositor *compositor)
compositor->xwayland_abstract_fd = bind_to_abstract_socket (display);
if (compositor->xwayland_abstract_fd < 0)
{
unlink (lockfile);

if (errno == EADDRINUSE)
{
unlink (lockfile);
display++;
continue;
}
else
return FALSE;
}

compositor->xwayland_unix_fd = bind_to_unix_socket (display);
if (compositor->xwayland_abstract_fd < 0)
{
unlink (lockfile);

if (errno == EADDRINUSE)
{
display++;
continue;
}
else
return FALSE;
}
compositor->xwayland_unix_fd = bind_to_unix_socket (display);
if (compositor->xwayland_abstract_fd < 0)
{
unlink (lockfile);
close (compositor->xwayland_abstract_fd);
return FALSE;
}

break;
Expand Down

0 comments on commit 4fa2b36

Please sign in to comment.