From: VMware, Inc <> Date: Thu, 17 Jun 2010 21:27:36 +0000 (-0700) Subject: lib/lock: lock creation error on XP X-Git-Tag: 2010.06.16-268169~124 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=830503d4ac09a119a935d2b5c8db1e937c76f72c;p=thirdparty%2Fopen-vm-tools.git lib/lock: lock creation error on XP The code needs to return an error number, not a bool. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/lock/ulInt.h b/open-vm-tools/lib/lock/ulInt.h index 4c4a76550..17637cd41 100644 --- a/open-vm-tools/lib/lock/ulInt.h +++ b/open-vm-tools/lib/lock/ulInt.h @@ -99,10 +99,14 @@ typedef struct { static INLINE int MXRecLockCreateInternal(MXRecLock *lock) // IN/OUT: { + Bool success; + /* http://msdn.microsoft.com/en-us/library/ms682530(VS.85).aspx */ /* magic number - allocate resources immediately; spin 0x400 times */ - return InitializeCriticalSectionAndSpinCount(&lock->nativeLock, - 0x80000400) != 0; + success = InitializeCriticalSectionAndSpinCount(&lock->nativeLock, + 0x80000400); + + return success ? 0 : GetLastError(); }