Skip to content

Conversation

@n-p-soft
Copy link

@n-p-soft n-p-soft commented Nov 12, 2025

Due to two typos, midi_poll was always failing, as the 'revents' field was not properly set.
Signed-off-by: Nicolas Provost [email protected]

Due to two typos, midi_poll was always failing, as the 'revents' field was not properly set.
@github-actions
Copy link

github-actions bot commented Nov 12, 2025

Thank you for taking the time to contribute to FreeBSD!
There are a few issues that need to be fixed:

Please review CONTRIBUTING.md, then update and push your branch again.

midi_poll should return one if revents is not zero.
@markjdb
Copy link
Member

markjdb commented Nov 16, 2025

@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.

@gmshake
Copy link
Contributor

gmshake commented Nov 16, 2025

I think the fix is right. Ref: the very first version of the midi.c from NetBSD [1].

[1] NetBSD/src@48bae9e#diff-dadfe9a149c74b946edbe5f3764799be7ba664df592dcc04bef1d70f003a2a10

mtx_unlock(&m->qlock);

return (revents);
return (revents ? 1 : 0);
Copy link
Contributor

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?

Copy link
Author

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.

Copy link
Contributor

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]>
@christosmarg
Copy link
Contributor

The change is good. Can you please combine those into one commit and rebase on top main?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants