mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-06-06 07:37:21 +02:00

This exposed a bunch of issues that needed dealing with to ensure the code is clean and sane. Notably the dlopen/dlsym routine has been altered to closer match the LSI approach of safe symbol binding, by not attempting to directly cast the result of a dlsym operation. Instead, if we succeed in getting the dlsym() pointer, we memcpy this to the target and ensure we have the correct constraints. Note that in sanitizing the log helpers, I opted to remove the varargs ability from FATAL_ERRNO given this is used exactly like perror() and there are no examples currently using varargs with this in the tree. This allowed me to keep the log helpers as macros and not have to implement wrapper functions. Signed-off-by: Ikey Doherty <ikey@solus-project.com>