summaryrefslogtreecommitdiff
path: root/src/libsystemd-terminal/idev-evdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd-terminal/idev-evdev.c')
-rw-r--r--src/libsystemd-terminal/idev-evdev.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/libsystemd-terminal/idev-evdev.c b/src/libsystemd-terminal/idev-evdev.c
index 6509d1011e..18c48ee592 100644
--- a/src/libsystemd-terminal/idev-evdev.c
+++ b/src/libsystemd-terminal/idev-evdev.c
@@ -314,11 +314,7 @@ static int idev_evdev_resume(idev_evdev *evdev, int dev_fd) {
return -EACCES;
evdev->element.readable = true;
- evdev->element.writable = true;
- if (flags == O_RDONLY)
- evdev->element.writable = false;
- else if (flags == O_WRONLY)
- evdev->element.readable = false;
+ evdev->element.writable = !(flags & O_RDONLY);
/*
* TODO: We *MUST* re-sync the device so we get a delta of the changed