mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
Fix Darwin sockets nonblocking
Co-authored-by: Weijia Wang <contact@weijia.wang> Signed-off-by: Torrekie Gen <me@torrekie.dev>
This commit is contained in:
parent
50fe36c812
commit
d135666e88
1 changed files with 8 additions and 0 deletions
|
|
@ -39,6 +39,10 @@
|
|||
#include <sys/stat.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#include <pthread.h>
|
||||
#include <poll.h>
|
||||
|
||||
|
|
@ -1499,6 +1503,10 @@ send_overflow_client(void *data)
|
|||
/* Limit the send buffer size for the display socket to guarantee
|
||||
* that the test will cause an overflow. */
|
||||
sock = wl_display_get_fd(c->wl_display);
|
||||
#if __APPLE__
|
||||
/* Darwin sockets may by non-blocked after accept() */
|
||||
assert(fcntl(sock, F_SETFL, ~O_NONBLOCK) != -1);
|
||||
#endif
|
||||
assert(setsockopt(sock, SOL_SOCKET, SO_SNDBUF, &optval, sizeof(optval)) == 0);
|
||||
|
||||
/* Request to break out of 'display_run' in the main process */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue