tablet-pad-leds: Open led file with O_NONBLOCK | O_CLOEXEC

We don't want the file to be left open after any fork/exec, and we don't
want the read to be blocking; so open it as such.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
(cherry picked from commit f723b28220)
This commit is contained in:
Jonas Ådahl 2021-04-06 16:33:42 +02:00 committed by Peter Hutterer
parent 0d3d885a1a
commit 0cfe00f493

View file

@ -132,7 +132,7 @@ pad_led_new(struct libinput *libinput, const char *prefix, int group, int mode)
if (rc == -1)
goto error;
fd = open_restricted(libinput, path, O_RDONLY);
fd = open_restricted(libinput, path, O_RDONLY | O_NONBLOCK | O_CLOEXEC);
if (fd < 0) {
errno = -fd;
goto error;