]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
lib/lock: lock creation error on XP
authorVMware, Inc <>
Thu, 17 Jun 2010 21:27:36 +0000 (14:27 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 17 Jun 2010 21:27:36 +0000 (14:27 -0700)
The code needs to return an error number, not a bool.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/lock/ulInt.h

index 4c4a765507d9b197d48df24bb4290175e7b9d919..17637cd41c71c06bb03aef9c2d84dd7e672220a4 100644 (file)
@@ -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();
 }