-
Notifications
You must be signed in to change notification settings - Fork 3.1k
sound/midi: midi_poll is always failing. #1887
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
base: main
Are you sure you want to change the base?
Conversation
Due to two typos, midi_poll was always failing, as the 'revents' field was not properly set.
|
Thank you for taking the time to contribute to FreeBSD! Please review CONTRIBUTING.md, then update and push your branch again. |
midi_poll should return one if revents is not zero.
|
@christosmarg could you please take a look at this? The patch seems obviously right. The commit log message needs to be fixed up a little. |
|
I think the fix is right. Ref: the very first version of the midi.c from NetBSD [1]. [1] NetBSD/src@48bae9e#diff-dadfe9a149c74b946edbe5f3764799be7ba664df592dcc04bef1d70f003a2a10 |
sys/dev/sound/midi/midi.c
Outdated
| mtx_unlock(&m->qlock); | ||
|
|
||
| return (revents); | ||
| return (revents ? 1 : 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to return revents as it is? Why are you returning a bool?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must check that. The generic poll system call returns the count of file descriptors having matching events.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what's returned to usersland by poll(2), but the kernel poll() methods return event bitmasks.
…', not a count of descriptors. Signed-off-by: Nicolas Provost <[email protected]>
|
The change is good. Can you please combine those into one commit and rebase on top |
Due to two typos, midi_poll was always failing, as the 'revents' field was not properly set.
Signed-off-by: Nicolas Provost [email protected]