[asterisk-commits] russell: branch 1.4 r72926 - /branches/1.4/main/manager.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 2 13:18:47 CDT 2007


Author: russell
Date: Mon Jul  2 13:18:46 2007
New Revision: 72926

URL: http://svn.digium.com/view/asterisk?view=rev&rev=72926
Log:
Remove a bogus comment and add proper locking to the handler function for the
CLI command to show information on manager actions.

Modified:
    branches/1.4/main/manager.c

Modified: branches/1.4/main/manager.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/manager.c?view=diff&rev=72926&r1=72925&r2=72926
==============================================================================
--- branches/1.4/main/manager.c (original)
+++ branches/1.4/main/manager.c Mon Jul  2 13:18:46 2007
@@ -438,7 +438,6 @@
 	ast_mutex_unlock(&s->__lock);
 }
 
-/*! \note The actionlock is read-locked by the caller of this function */
 static int handle_showmancmd(int fd, int argc, char *argv[])
 {
 	struct manager_action *cur;
@@ -448,6 +447,7 @@
 	if (argc != 4)
 		return RESULT_SHOWUSAGE;
 
+	ast_rwlock_rdlock(&actionlock);
 	for (cur = first_action; cur; cur = cur->next) { /* Walk the list of actions */
 		for (num = 3; num < argc; num++) {
 			if (!strcasecmp(cur->action, argv[num])) {
@@ -455,6 +455,7 @@
 			}
 		}
 	}
+	ast_rwlock_unlock(&actionlock);
 
 	return RESULT_SUCCESS;
 }




More information about the asterisk-commits mailing list