trylock may return positive or negative on failure. <sigh>
authoraland <aland>
Thu, 15 May 2003 14:54:18 +0000 (14:54 +0000)
committeraland <aland>
Thu, 15 May 2003 14:54:18 +0000 (14:54 +0000)
Patch from Liyan Tan

src/modules/rlm_sql/sql.c

index 174dc35..180ce7c 100644 (file)
@@ -197,7 +197,7 @@ SQLSOCK * sql_get_socket(SQL_INST * inst)
                 *
                 *      If it isn't used, then grab it ourselves.
                 */
-               if (pthread_mutex_trylock(&cur->mutex) < 0) {
+               if (pthread_mutex_trylock(&cur->mutex) != 0) {
                        goto next;
                } /* else we now have the lock */
 #endif