summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-09-16 23:00:26 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2014-09-16 23:01:48 +0200
commit1164e944d9689c3e94c100a634fb5a404662e247 (patch)
treee0e0b3bc039a4b8cba90bc44407aaf1a6c961eb9
parentcca0efb0477f9bb7d61b48ba270b885b29c0bb72 (diff)
terminal: remove dead code checking O_WRONLY
We only reject evdev FDs that are O_WRONLY as they're currently pretty useless. The following check for O_WRONLY is thus never excercised so drop it. Thanks to Thomas Andersen (via coverity)!
-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