summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--toolbox/getevent.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toolbox/getevent.c b/toolbox/getevent.c
index e6def6bae..39033ad4d 100644
--- a/toolbox/getevent.c
+++ b/toolbox/getevent.c
@@ -321,7 +321,7 @@ static int open_device(const char *device, int print_flags)
char idstr[80];
struct input_id id;
- fd = open(device, O_RDWR);
+ fd = open(device, O_RDONLY | O_CLOEXEC);
if(fd < 0) {
if(print_flags & PRINT_DEVICE_ERRORS)
fprintf(stderr, "could not open %s, %s\n", device, strerror(errno));