== DETAILS
If a call to HIDRead() ends up blocking indefinitely, it will
cause the shutdown process to wait forever.
To avoid a deadlock, I've put in a retry counter so that it will
give up after 5s and print a warning to the log.
This is a proof of concept for the fallback path without pkg-config.
As jack is something often not installed by default it demonstrates
that when pkg-config exists and the dependency doesn't the check_val
function in qb/qb.libs.sh will redundantly check -ljack and as expected,
fail. It also shows that when pkg-config is not installed and jack is
enabled with --enable-jack it will bail and print a configure error.
This accomplishes two things for the fallback path without pkg-config.
1. If --disable-foo is passed to configure it will explicitly skip
check_val. This has the benefit of reducing checks in
qb/config.libs.sh which are easy to break due to human error.
2. When a fallback path exists and --enable-foo is passed to configure,
but fails due to the missing -lfoo check_val will now bail and print
a configure error. However --enable-foo will still be ignored if
there is no fallback path and pkg-config is not installed.
One issue with this is that if pkg-config is installed and the package
foo is not, it will still check if -lfoo works. As not all pkg-config
implemenations can be trusted to work even if they exist this seems
unavoidable.
== DETAILS
I fixed a similar bug in a past commit, with the same root cause: making
assumptions about the length of the array.
- Add validation to joypad_connection_init() so that if >MAX_USERS is
requested, a warning is logged and only MAX_USERS is allocated.
- Rewrote the iteration routines so they strictly use the
joypad_is_end_of_list() method to detect the end.