This repository has been archived by the owner on May 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
device: Simplify uevent matching in listenToUdevEvents()
This function watches for uvents that match addresses stored in s.deviceWatchers() and if there's a matching entry signals the associated channel. "Matching" in this instance means soem sort of comparison between the address we're watching for and the sysfs path in the uevent. Currently we match any of a bunch of different cases for different types of device. Being very specific with how we match *sounds* like a good idea, but it's complicated, tightly coupled to other parts of the code and, ultimately, pointless. The user of the data we're collecting here is getDeviceName(). Before registering a watcher it checks s.sysToDevMap in case the uevent it's interested in has already happened. To have consistent behaviour regardless of when the uevent arrives, the matching that getDeviceName() uses against s.sysToDevMap must be the same as we use in listenToUdevEvents() and right now, it's not. So, change the matching in listenToUdevEvents() to be the same as the much simpler version in getDeviceName(). fixes #848 Signed-off-by: David Gibson <[email protected]>
- Loading branch information
Showing
5 changed files
with
6 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters