mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-03-12 05:34:41 -04:00
Avoid SOCK_CLOEXEC on Darwin
Signed-off-by: Torrekie Gen <me@torrekie.dev>
This commit is contained in:
parent
91484e380f
commit
3c6a88253c
8 changed files with 155 additions and 8 deletions
|
|
@ -40,7 +40,14 @@ TEST(create_resource_tst)
|
|||
int s[2];
|
||||
uint32_t id;
|
||||
|
||||
#ifdef SOCK_CLOEXEC
|
||||
assert(socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, s) == 0);
|
||||
#else
|
||||
assert(socketpair(AF_UNIX, SOCK_STREAM, 0, s) == 0);
|
||||
assert(set_cloexec_or_close(s[0]) != -1);
|
||||
assert(set_cloexec_or_close(s[1]) != -1);
|
||||
#endif
|
||||
|
||||
display = wl_display_create();
|
||||
assert(display);
|
||||
client = wl_client_create(display, s[0]);
|
||||
|
|
@ -111,7 +118,13 @@ TEST(destroy_res_tst)
|
|||
.notify = &destroy_notify
|
||||
};
|
||||
|
||||
#ifdef SOCK_CLOEXEC
|
||||
assert(socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, s) == 0);
|
||||
#else
|
||||
assert(socketpair(AF_UNIX, SOCK_STREAM, 0, s) == 0);
|
||||
assert(set_cloexec_or_close(s[0]) != -1);
|
||||
assert(set_cloexec_or_close(s[1]) != -1);
|
||||
#endif
|
||||
display = wl_display_create();
|
||||
assert(display);
|
||||
client = wl_client_create(display, s[0]);
|
||||
|
|
@ -159,7 +172,13 @@ TEST(create_resource_with_same_id)
|
|||
int s[2];
|
||||
uint32_t id;
|
||||
|
||||
#ifdef SOCK_CLOEXEC
|
||||
assert(socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, s) == 0);
|
||||
#else
|
||||
assert(socketpair(AF_UNIX, SOCK_STREAM, 0, s) == 0);
|
||||
assert(set_cloexec_or_close(s[0]) != -1);
|
||||
assert(set_cloexec_or_close(s[1]) != -1);
|
||||
#endif
|
||||
display = wl_display_create();
|
||||
assert(display);
|
||||
client = wl_client_create(display, s[0]);
|
||||
|
|
@ -243,7 +262,13 @@ TEST(resource_destroy_iteration)
|
|||
.notify = &resource_destroy_notify
|
||||
};
|
||||
|
||||
#ifdef SOCK_CLOEXEC
|
||||
assert(socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, s) == 0);
|
||||
#else
|
||||
assert(socketpair(AF_UNIX, SOCK_STREAM, 0, s) == 0);
|
||||
assert(set_cloexec_or_close(s[0]) != -1);
|
||||
assert(set_cloexec_or_close(s[1]) != -1);
|
||||
#endif
|
||||
display = wl_display_create();
|
||||
assert(display);
|
||||
client = wl_client_create(display, s[0]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue