summaryrefslogtreecommitdiffhomepage
path: root/compat
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-09-19 12:20:30 +0200
committerStanislaw Halik <sthalik@misaki.pl>2013-09-19 12:20:30 +0200
commitaf71f2534fc1e99ed7d483190e99d4dc674bcd76 (patch)
tree67ba43c14440adb6639b716e993883b7b7c8a431 /compat
parentf3aa3b391bb5159801029770d139c1cc0bfc9df5 (diff)
compat: new API, check for success
Diffstat (limited to 'compat')
-rw-r--r--compat/compat.cpp9
-rw-r--r--compat/compat.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/compat/compat.cpp b/compat/compat.cpp
index d8aac9bc..f6261738 100644
--- a/compat/compat.cpp
+++ b/compat/compat.cpp
@@ -61,6 +61,15 @@ PortableLockedShm::PortableLockedShm(const char *shmName, const char *mutexName,
mem = (void*) -1;
}
+PortableLockedShm::success()
+{
+#ifndef _WIN32
+ return (void*) mem != (void*) -1
+#else
+ return (void*) mem != NULL;
+#endif
+}
+
PortableLockedShm::~PortableLockedShm()
{
//(void) shm_unlink(shm_filename);
diff --git a/compat/compat.h b/compat/compat.h
index 3d54ae1d..8c307b14 100644
--- a/compat/compat.h
+++ b/compat/compat.h
@@ -37,6 +37,7 @@ public:
~PortableLockedShm();
void lock();
void unlock();
+ bool success();
void* mem;
private:
#if defined(_WIN32)