|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From 1164e944d9689c3e94c100a634fb5a404662e247 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: David Herrmann <dh.herrmann@gmail.com>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Tue, 16 Sep 2014 23:00:26 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] terminal: remove dead code checking O_WRONLY
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
We only reject evdev FDs that are O_WRONLY as they're currently pretty
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
useless. The following check for O_WRONLY is thus never excercised so drop
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
it.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Thanks to Thomas Andersen (via coverity)!
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/libsystemd-terminal/idev-evdev.c | 6 +-----
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 1 insertion(+), 5 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/libsystemd-terminal/idev-evdev.c b/src/libsystemd-terminal/idev-evdev.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 6509d1011e..18c48ee592 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/libsystemd-terminal/idev-evdev.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/libsystemd-terminal/idev-evdev.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -314,11 +314,7 @@ static int idev_evdev_resume(idev_evdev *evdev, int dev_fd) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return -EACCES;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
evdev->element.readable = true;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- evdev->element.writable = true;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- if (flags == O_RDONLY)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- evdev->element.writable = false;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- else if (flags == O_WRONLY)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- evdev->element.readable = false;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ evdev->element.writable = !(flags & O_RDONLY);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
/*
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
* TODO: We *MUST* re-sync the device so we get a delta of the changed
|