mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-21 06:59:46 -05:00
Fall back to accept() on systems where accept4() is not implemented.
This commit is contained in:
parent
b06e891e4c
commit
02e1ffdefe
1 changed files with 7 additions and 1 deletions
|
|
@ -703,8 +703,14 @@ socket_data(int fd, uint32_t mask, void *data)
|
||||||
length = sizeof name;
|
length = sizeof name;
|
||||||
client_fd =
|
client_fd =
|
||||||
accept4(fd, (struct sockaddr *) &name, &length, SOCK_CLOEXEC);
|
accept4(fd, (struct sockaddr *) &name, &length, SOCK_CLOEXEC);
|
||||||
|
if (client_fd < 0 && errno == ENOSYS) {
|
||||||
|
client_fd = accept(fd, (struct sockaddr *) &name, &length);
|
||||||
|
if (client_fd >= 0 && fcntl(client_fd, F_SETFD, FD_CLOEXEC) == -1)
|
||||||
|
fprintf(stderr, "failed to set FD_CLOEXEC flag on client fd, errno: %d\n", errno);
|
||||||
|
}
|
||||||
|
|
||||||
if (client_fd < 0)
|
if (client_fd < 0)
|
||||||
fprintf(stderr, "failed to accept\n");
|
fprintf(stderr, "failed to accept, errno: %d\n", errno);
|
||||||
|
|
||||||
wl_client_create(display, client_fd);
|
wl_client_create(display, client_fd);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue