ei: Use the signal protected wrappers

To prevent against unexpected interrupted system calls.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
This commit is contained in:
Olivier Fourdan 2022-12-06 14:25:33 +01:00 committed by Peter Hutterer
parent 1991b8f52d
commit 8bcbc53c0f
3 changed files with 3 additions and 3 deletions

View file

@ -203,7 +203,7 @@ ei_keymap_new(enum ei_keymap_type type, int fd, size_t size)
if (fd < 0 || size == 0)
return NULL;
int newfd = dup(fd);
int newfd = xdup(fd);
if (newfd < 0)
return NULL;

View file

@ -75,7 +75,7 @@ eis_device_new_keymap(struct eis_device *device,
if (fd < 0 || size == 0)
return NULL;
int newfd = dup(fd);
int newfd = xdup(fd);
if (newfd < 0)
return NULL;

View file

@ -74,7 +74,7 @@ reis_new(int eisfd)
{
_unref_(reis) *reis = reis_create(NULL);
reis->eisfd = dup(eisfd);
reis->eisfd = xdup(eisfd);
if (reis->eisfd == -1)
return NULL;