Revision: 7256
          http://svn.sourceforge.net/mahogany/?rev=7256&view=rev
Author:   vadz
Date:     2007-04-28 17:39:19 -0700 (Sat, 28 Apr 2007)

Log Message:
-----------
correct _ds_acquire_lock() return value under Win32 and the way the check for 
it is done

Modified Paths:
--------------
    trunk/M/lib/dspam/src/hash_drv.c
    trunk/M/lib/dspam/src/util.c

Modified: trunk/M/lib/dspam/src/hash_drv.c
===================================================================
--- trunk/M/lib/dspam/src/hash_drv.c    2007-04-29 00:14:01 UTC (rev 7255)
+++ trunk/M/lib/dspam/src/hash_drv.c    2007-04-29 00:39:19 UTC (rev 7256)
@@ -537,7 +537,7 @@
 
     lock_result = _hash_drv_lock_get (CTX, s, 
       (CTX->group) ? CTX->group : CTX->username);
-    if (lock_result < 0) 
+    if (lock_result) 
       goto BAIL;
 
     ret = _hash_drv_open(db, s->map, s->hash_rec_max, s->max_seek, 

Modified: trunk/M/lib/dspam/src/util.c
===================================================================
--- trunk/M/lib/dspam/src/util.c        2007-04-29 00:14:01 UTC (rev 7255)
+++ trunk/M/lib/dspam/src/util.c        2007-04-29 00:39:19 UTC (rev 7256)
@@ -651,7 +651,7 @@
 
   /* we don't have to do anything to acquire it, we just need to check if we
    * opened an existing mutex or created a new one */
-  return GetLastError() != ERROR_ALREADY_EXISTS;
+  return GetLastError() == ERROR_ALREADY_EXISTS ? ENOLCK : 0;
 }
 
 int _ds_release_lock(_ds_lock_t lock)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to