summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2021-04-06 16:33:42 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2021-04-29 10:58:24 +1000
commit0cfe00f4932fb64d1c07284b61061f1d25d482bd (patch)
treed78036b0c4413842228ece7f13ad8c9d52ec4d1c
parent0d3d885a1abb062438df55f5997438521245df28 (diff)
downloadlibinput-0cfe00f4932fb64d1c07284b61061f1d25d482bd.tar.gz
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 f723b28220adc64552c4ce26c4c9054494ea0141)
-rw-r--r--src/evdev-tablet-pad-leds.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/evdev-tablet-pad-leds.c b/src/evdev-tablet-pad-leds.c
index ff21878f..3d5e1702 100644
--- a/src/evdev-tablet-pad-leds.c
+++ b/src/evdev-tablet-pad-leds.c
@@ -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;