diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2021-04-06 16:33:42 +0200 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2021-04-29 10:58:24 +1000 |
commit | 0cfe00f4932fb64d1c07284b61061f1d25d482bd (patch) | |
tree | d78036b0c4413842228ece7f13ad8c9d52ec4d1c | |
parent | 0d3d885a1abb062438df55f5997438521245df28 (diff) |
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.c | 2 |
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; |