[asterisk-commits] russell: branch russell/events r84628 - /team/russell/events/res/ais/lck.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Oct 3 21:44:43 CDT 2007


Author: russell
Date: Wed Oct  3 21:44:43 2007
New Revision: 84628

URL: http://svn.digium.com/view/asterisk?view=rev&rev=84628
Log:
suppress some compiler warnings and fix a couple typos

Modified:
    team/russell/events/res/ais/lck.c

Modified: team/russell/events/res/ais/lck.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/res/ais/lck.c?view=diff&rev=84628&r1=84627&r2=84628
==============================================================================
--- team/russell/events/res/ais/lck.c (original)
+++ team/russell/events/res/ais/lck.c Wed Oct  3 21:44:43 2007
@@ -171,8 +171,8 @@
 {
 	struct ast_datastore *datastore;
 	SaAisErrorT ais_res;
-	SaLckLockModeT mode;
-	SaLckLockFlagsT flags;
+	SaLckLockModeT mode = 0;
+	SaLckLockFlagsT flags = 0;
 	SaLckLockStatusT status;
 
 	ast_channel_lock(chan);
@@ -190,13 +190,20 @@
 	switch (lock_type) {
 	case TRY_RDLOCK:
 		flags = SA_LCK_LOCK_NO_QUEUE;
+		mode = SA_LCK_PR_LOCK_MODE;
+		break;
 	case RDLOCK:
+		flags = SA_LCK_LOCK_NO_QUEUE;
 		mode = SA_LCK_PR_LOCK_MODE;
 		break;
 	case TRY_WRLOCK:
 		flags = SA_LCK_LOCK_NO_QUEUE;
+		mode = SA_LCK_EX_LOCK_MODE;
+		break;
 	case WRLOCK:
+		flags = SA_LCK_LOCK_NO_QUEUE;
 		mode = SA_LCK_EX_LOCK_MODE;
+		break;
 	}
 
 	/* Actually acquire the lock now */
@@ -333,10 +340,10 @@
 	ast_autoservice_start(chan);
 	
 	ast_channel_lock(chan);
-	datastore = ast_channel_datastore_find(chan, &dlock_datastore_info, lock->name->str);
+	datastore = ast_channel_datastore_find(chan, &dlock_datastore_info, data);
 	if (!datastore) {
 		ast_log(LOG_ERROR, "The DLOCK '%s' is not locked by channel '%s'\n",
-			lock->name->str, chan->name);
+			data, chan->name);
 		ast_channel_unlock(chan);
 		ast_copy_string(buf, "FAILURE", len);
 		return -1;




More information about the asterisk-commits mailing list