mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-08 12:28:04 +02:00
clients: close unused keymap fd
In the simple examples in which keymap is not handled, the open
descriptor has to be properly closed.
After each suspend/resume sequence the keymap is send again to
every client. On client weston-simple-egl the leak causes a
segfault when no more file descriptors can be opened.
Close the file descriptor and lazily copy/paste the comment
already available in simple-dmabuf-v4l.
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
(cherry picked from commit 4071225cdc)
This commit is contained in:
parent
5b1bf97245
commit
ffb78089ba
3 changed files with 7 additions and 0 deletions
|
|
@ -296,6 +296,8 @@ static void
|
|||
keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard,
|
||||
uint32_t format, int fd, uint32_t size)
|
||||
{
|
||||
/* Just so we don’t leak the keymap fd */
|
||||
close(fd);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -640,6 +640,8 @@ static void
|
|||
keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard,
|
||||
uint32_t format, int fd, uint32_t size)
|
||||
{
|
||||
/* Just so we don’t leak the keymap fd */
|
||||
close(fd);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#include <time.h>
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <wayland-client.h>
|
||||
|
||||
|
|
@ -463,6 +464,8 @@ static void
|
|||
keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard,
|
||||
uint32_t format, int fd, uint32_t size)
|
||||
{
|
||||
/* Just so we don’t leak the keymap fd */
|
||||
close(fd);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue