-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Input: Ensure clearTimer won't compute a lower nfds value than one of our opened fds #1685
Merged
Conversation
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
sorted in increasing fd numbers This doesn't necessarily hold true in practice (e.g., if one were to first open an fd during a directory walk with a few dir/file fds open...)
Just so that I remember to fix that one day ;). (Possibly by sorting the |
our opened fds By making sure in openInputDevice that the top member of the array also happens to be the highest fd number.
NiLuJe
changed the title
Input: Mention that nfds computations assume the inputfds array is
Input: Ensure clearTimer won't compute a lower nfds value than one our opened fds
Oct 30, 2023
Open random fds between diff --git a/frontend/device/kobo/device.lua b/frontend/device/kobo/device.lua
index e2df4a95a..dd2f94322 100644
--- a/frontend/device/kobo/device.lua
+++ b/frontend/device/kobo/device.lua
@@ -816,12 +816,16 @@ function Kobo:init()
-- And then handle the extra shenanigans if necessary.
self:initEventAdjustHooks()
+ local f = io.open("/dev/null", "r")
+ local f2 = io.open("/dev/null", "w")
-- Various HW Buttons, Switches & Synthetic NTX events
self.ntx_fd = self.input.open(self.ntx_dev)
-- Dedicated Power Button input device (if any)
if self.power_dev then
self.input.open(self.power_dev)
end
+ f:close()
+ f2:close()
-- Touch panel
self.input.open(self.touch_dev)
-- NOTE: On devices with a gyro, there may be a dedicated input device outputting the raw accelerometer data Then |
NiLuJe
changed the title
Input: Ensure clearTimer won't compute a lower nfds value than one our opened fds
Input: Ensure clearTimer won't compute a lower nfds value than one of our opened fds
Oct 30, 2023
Frenzie
approved these changes
Oct 30, 2023
Frenzie
added a commit
to Frenzie/koreader
that referenced
this pull request
Nov 2, 2023
Includes: * Input: Ensure clearTimer won't compute a lower nfds value than one of our opened fds <koreader/koreader-base#1685> Also includes various dependency bumps. <koreader/koreader-base@16a856a...master>
Frenzie
added a commit
to koreader/koreader
that referenced
this pull request
Nov 2, 2023
Includes: * Input: Ensure clearTimer won't compute a lower nfds value than one of our opened fds <koreader/koreader-base#1685> Also includes various dependency bumps. <koreader/koreader-base@16a856a...master>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By making sure in openInputDevice that the top member of the array also happens to be the highest fd number.
Initial draft below:
Mention that nfds computations assume the inputfds array is sorted in increasing fd numbers
This doesn't necessarily hold true in practice (e.g., if one were to first open an fd during a directory walk with a few dir/file fds open...)
This change is