summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2021-04-06 16:33:42 +0200
committerJonas Ådahl <jadahl@gmail.com>2021-04-06 16:33:42 +0200
commitf723b28220adc64552c4ce26c4c9054494ea0141 (patch)
tree02c67ce76117fb230f7e955b2222a6cb35cf112b
parentc71a1f4347013cf94254c1ea421b3a313a125b35 (diff)
downloadlibinput-f723b28220adc64552c4ce26c4c9054494ea0141.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>
-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 3aca9ec6..9d81ec7a 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;