From 0cfe00f4932fb64d1c07284b61061f1d25d482bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 6 Apr 2021 16:33:42 +0200 Subject: [PATCH] tablet-pad-leds: Open led file with O_NONBLOCK | O_CLOEXEC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (cherry picked from commit f723b28220adc64552c4ce26c4c9054494ea0141) --- src/evdev-tablet-pad-leds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;