summaryrefslogtreecommitdiffhomepage
path: root/x-plane-plugin
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-11-30 18:05:40 +0100
committerStanislaw Halik <sthalik@misaki.pl>2013-11-30 18:05:40 +0100
commit3004416b35dea148212d4aa881ae099d20f3e313 (patch)
treed66cf42d5855a2ce3d06c2dab81a31007eaa29d8 /x-plane-plugin
parentf413502750855ea1394e12650395697bcab01498 (diff)
untested merge from compat, hopefully fix osx
Signed-off-by: Stanislaw Halik <sthalik@misaki.pl>
Diffstat (limited to 'x-plane-plugin')
-rw-r--r--x-plane-plugin/plugin.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/x-plane-plugin/plugin.c b/x-plane-plugin/plugin.c
index ed6cdaff..62c9d6f0 100644
--- a/x-plane-plugin/plugin.c
+++ b/x-plane-plugin/plugin.c
@@ -62,10 +62,8 @@ PortableLockedShm* PortableLockedShm_init(const char *shmName, const char *OT_UN
/* (void) shm_unlink(shm_filename); */
self->fd = shm_open(shm_filename, O_RDWR | O_CREAT, 0600);
- if (ftruncate(self->fd, mapSize) == 0)
- self->mem = mmap(NULL, mapSize, PROT_READ|PROT_WRITE, MAP_SHARED, self->fd, (off_t)0);
- else
- self->mem = (void*) -1;
+ (void) ftruncate(self->fd, mapSize);
+ self->mem = mmap(NULL, mapSize, PROT_READ|PROT_WRITE, MAP_SHARED, self->fd, (off_t)0);
return self;
}