mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-06-06 23:57:22 +02:00

When there are not valid standard file descriptors then strange things can happen. When new file descriptors are opened, they will take the place of the former standard file descriptors and when e.g. somebody calls printf() they will write to some file descriptor that is not prepared for it. This would already happen during PLOG_MSG() in gamemoded. Actually this also causes a SIGABRT when calling gamemoded like this: ```bash gamemoded -d ``` This is due to a bug [1] in systemd that causes an assertion to be triggered. This shows that file descriptor zero is in this case being replaced by a UNIX domain socket representing the connection to the D-Bus session bus. Therefore instead of just closing the standard file descriptors, replace them by appropriate file descriptors refering to /dev/null. [1]: https://github.com/systemd/systemd/issues/8080