summaryrefslogtreecommitdiffhomepage
path: root/compat/compat.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-11-03 21:34:49 +0100
committerStanislaw Halik <sthalik@misaki.pl>2013-11-03 21:34:49 +0100
commitbbaefce3a90b3c45f23e494f76ed15fa9a00d5e8 (patch)
tree28ef5677081348be4a3addf8e28028990245cd4b /compat/compat.cpp
parentcc9b496e2de68b983dbc5fde27a1379cc9602a35 (diff)
fix apple build
Diffstat (limited to 'compat/compat.cpp')
-rw-r--r--compat/compat.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/compat/compat.cpp b/compat/compat.cpp
index bcdbd17f..7b695617 100644
--- a/compat/compat.cpp
+++ b/compat/compat.cpp
@@ -6,8 +6,7 @@
*/
#define IN_FTNOIR_COMPAT
#include "compat.h"
-#include <string>
-#include <sstream>
+#include <string.h>
#if defined(_WIN32)
@@ -48,17 +47,11 @@ void PortableLockedShm::unlock()
#else
PortableLockedShm::PortableLockedShm(const char *shmName, const char* /*mutexName*/, int mapSize) : size(mapSize)
{
- std::string filename;
- filename.append("/");
- filename.append(shmName);
- //(void) shm_unlink(shm_filename);
-
- fd = shm_open(filename.c_str(), O_RDWR | O_CREAT, 0600);
- if (ftruncate(fd, mapSize) == 0) { ;; }
- else {
- fprintf(stderr, "oh, bother, ftruncate: %s\n", strerror(errno));
- //mem = (void*) -1;
- }
+ char filename[512] = {0};
+ strcpy(filename, "/");
+ strcat(filename, shmName);
+ fd = shm_open(filename, O_RDWR | O_CREAT, 0600);
+ (void) ftruncate(fd, mapSize);
mem = mmap(NULL, mapSize, PROT_READ|PROT_WRITE, MAP_SHARED, fd, (off_t)0);
}