diff options
Diffstat (limited to 'opentrack-compat')
-rw-r--r-- | opentrack-compat/process-list.hpp | 7 | ||||
-rw-r--r-- | opentrack-compat/shm.cpp | 5 | ||||
-rw-r--r-- | opentrack-compat/sleep.hpp | 2 |
3 files changed, 12 insertions, 2 deletions
diff --git a/opentrack-compat/process-list.hpp b/opentrack-compat/process-list.hpp index 65735740..ef3b325f 100644 --- a/opentrack-compat/process-list.hpp +++ b/opentrack-compat/process-list.hpp @@ -1,3 +1,10 @@ +/* Copyright (c) 2015 Stanislaw Halik <sthalik@misaki.pl> + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + #pragma once #include <QDebug> diff --git a/opentrack-compat/shm.cpp b/opentrack-compat/shm.cpp index b18a9933..029a4c95 100644 --- a/opentrack-compat/shm.cpp +++ b/opentrack-compat/shm.cpp @@ -43,10 +43,13 @@ void PortableLockedShm::unlock() (void) ReleaseMutex(hMutex); } #else + +#include <limits.h> + #pragma GCC diagnostic ignored "-Wunused-result" PortableLockedShm::PortableLockedShm(const char *shmName, const char* /*mutexName*/, int mapSize) : size(mapSize) { - char filename[512] = {0}; + char filename[PATH_MAX+2] = {0}; strcpy(filename, "/"); strcat(filename, shmName); fd = shm_open(filename, O_RDWR | O_CREAT, 0600); diff --git a/opentrack-compat/sleep.hpp b/opentrack-compat/sleep.hpp index 27920842..e7c70285 100644 --- a/opentrack-compat/sleep.hpp +++ b/opentrack-compat/sleep.hpp @@ -3,7 +3,7 @@ namespace portable { #ifdef _WIN32 - #include <windows.h> +# include <windows.h> template<typename = void> void sleep(unsigned milliseconds) |