From 635874182399703bb1ec2fc714eb49d0186bc61c Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 19 Sep 2013 12:46:36 +0200 Subject: wine-wrapper: use new bool compat::success() api --- ftnoir_protocol_wine/opentrack-wrapper-wine-main.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ftnoir_protocol_wine/opentrack-wrapper-wine-main.cxx b/ftnoir_protocol_wine/opentrack-wrapper-wine-main.cxx index a81bccae..6e512b6e 100644 --- a/ftnoir_protocol_wine/opentrack-wrapper-wine-main.cxx +++ b/ftnoir_protocol_wine/opentrack-wrapper-wine-main.cxx @@ -12,6 +12,7 @@ public: ~ShmPosix(); void lock(); void unlock(); + bool success(); void* mem; private: int fd, size; @@ -23,6 +24,7 @@ public: ~ShmWine(); void lock(); void unlock(); + bool success(); void* mem; private: void *hMutex, *hMapFile; @@ -33,11 +35,11 @@ int main(void) { ShmPosix lck_posix(WINE_SHM_NAME, WINE_MTX_NAME, sizeof(WineSHM)); ShmWine lck_wine("FT_SharedMem", "FT_Mutext", sizeof(FTMemMap)); - if(lck_posix.mem == (void*)-1) { + if(!lck_posix.success()) { printf("Can't open posix map: %d\n", errno); return 1; } - if(lck_wine.mem == NULL) { + if(!lck_wine.success()) { printf("Can't open Wine map\n"); return 1; } -- cgit v1.2.3