From 115f45ff41095057d44a174a7437c3ac1a8a3762 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 31 May 2012 08:53:24 +0300 Subject: Prevent evdevkeyboard file opening from failing On many systems the device nodes will not be writable normally. There is no reason to open for writing in any case. Also switched back to non-blocking I/O. Change-Id: I9290e6b1ce7e3bc6cb0e75069b3968f647ffbeee Reviewed-by: Girish Ramakrishnan --- src/plugins/generic/evdevkeyboard/qevdevkeyboardhandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/generic') diff --git a/src/plugins/generic/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/plugins/generic/evdevkeyboard/qevdevkeyboardhandler.cpp index 5574457fac..c963606305 100644 --- a/src/plugins/generic/evdevkeyboard/qevdevkeyboardhandler.cpp +++ b/src/plugins/generic/evdevkeyboard/qevdevkeyboardhandler.cpp @@ -124,7 +124,7 @@ QEvdevKeyboardHandler *QEvdevKeyboardHandler::create(const QString &device, cons #endif int fd; - fd = qt_safe_open(device.toLocal8Bit().constData(), O_RDWR, 0); + fd = qt_safe_open(device.toLocal8Bit().constData(), O_RDONLY | O_NDELAY, 0); if (fd >= 0) { if (repeatDelay > 0 && repeatRate > 0) { int kbdrep[2] = { repeatDelay, repeatRate }; -- cgit v1.2.3