mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-12-06 08:42:32 -08:00
fixup! Use sigaction to install signal handlers in bindings provider
Fix bindings provider build on Windows
This commit is contained in:
1 file changed
+6
@@ -216,10 +216,16 @@ int main() {
|
||||
constexpr auto interval = 1000ms / 30;
|
||||
|
||||
// Install signal handlers.
|
||||
// Windows does not provide sigaction
|
||||
#ifdef _WIN32
|
||||
signal(SIGINT, OnSignal);
|
||||
signal(SIGTERM, OnSignal);
|
||||
#else
|
||||
struct sigaction action{};
|
||||
action.sa_handler = OnSignal;
|
||||
sigaction(SIGINT, &action, nullptr);
|
||||
sigaction(SIGTERM, &action, nullptr);
|
||||
#endif
|
||||
|
||||
while (!should_exit) {
|
||||
vr::VREvent_t event{};
|
||||
|
||||
Reference in new issue
Block a user