mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-31 22:25:25 -04:00
os: wrap epoll_create
Some system C libraries do not have epoll_create1() nor EPOLL_CLOEXEC, provide a fallback. Add tests for the wrapper. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
This commit is contained in:
parent
35d5053c62
commit
b2eaf870cf
4 changed files with 74 additions and 1 deletions
|
|
@ -34,6 +34,7 @@
|
|||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
#include "wayland-server.h"
|
||||
#include "wayland-os.h"
|
||||
|
||||
struct wl_event_loop {
|
||||
int epoll_fd;
|
||||
|
|
@ -392,7 +393,7 @@ wl_event_loop_create(void)
|
|||
if (loop == NULL)
|
||||
return NULL;
|
||||
|
||||
loop->epoll_fd = epoll_create1(EPOLL_CLOEXEC);
|
||||
loop->epoll_fd = wl_os_epoll_create_cloexec();
|
||||
if (loop->epoll_fd < 0) {
|
||||
free(loop);
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue