Bug 89798

Summary: Cannot read events in non-blocking mode
Product: libevdev Reporter: g494074
Component: CoreAssignee: Peter Hutterer <peter.hutterer>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: peter.hutterer
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description g494074 2015-03-27 21:34:11 UTC
When trying to execute `libevdev_next_event(dev, LIBEVDEV_READ_FLAG_BLOCKING, &ev)`, the function call fails and prints the following error message:

libevdev error in libevdev_next_event: BUG: invalid flags 0x8

The problem is in line 999 of libevdev.c, which reads

	if (!(flags & (LIBEVDEV_READ_FLAG_NORMAL|LIBEVDEV_READ_FLAG_SYNC|LIBEVDEV_READ_FLAG_FORCE_SYNC))) {

when it should say

	if (!(flags & (LIBEVDEV_READ_FLAG_NORMAL|LIBEVDEV_READ_FLAG_SYNC|LIBEVDEV_READ_FLAG_FORCE_SYNC|LIBEVDEV_READ_FLAG_BLOCKING))) {
Comment 2 Peter Hutterer 2016-03-02 04:20:31 UTC
commit 97da13c3c4441b7ed7851dd215015998ad93320e
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Apr 7 07:12:01 2015 +1000

    Accept LIBEVDEV_READ_FLAG_BLOCKING as valid flag

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.