Skip to content
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

xwii_iface_open will fail with -EACCES if done too quickly after watch event #97

Open
PureTryOut opened this issue Jan 6, 2022 · 2 comments

Comments

@PureTryOut
Copy link

However, if you wait a second or so (probably a few hundred milliseconds will do) the same call will succeed.
I suppose it makes sense, the kernel has to handle for example the replugging of an extension, but this behaviour isn't documented anywhere and even xwiishow.c doesn't seem to be affected by it (I'm guessing some ncurses calls there are slow enough to not have this issue?).

@v1993
Copy link

v1993 commented Jan 8, 2022

There is devtype "pending" that supposed to signal device was just connected and you should initialize it on next WATCH event. However, for freshly connected devices devtype is "unknown" instead. As such, I currently retry every second until device type is not unknown, but having "pending" status work properly would be great.

This is trickier for extensions, since those don't have something like "pending" status even by design. This means that I have to delay processing of WATCH events by 500ms to avoid file not found/access denied errors.

@PureTryOut
Copy link
Author

but having "pending" status work properly would be great.

For a second I was wondering why this would be relevant, but now I understand. You're saying the lack of a "pending" status means we can not check if the device is ready to be checked for events again. However rather than a pending status for extensions, I rather have the watch event being send only after it's ready to listen for events again. I'm checking for new events in a loop every few milliseconds anyway, it can work just fine with no events till it's ready again.

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

No branches or pull requests

2 participants