[asterisk-commits] mjordan: branch 1.8 r381364 - /branches/1.8/apps/app_db.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Feb 13 21:42:09 CST 2013


Author: mjordan
Date: Wed Feb 13 21:42:06 2013
New Revision: 381364

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=381364
Log:
Don't throw a spurious error when using DBdeltree

The function call ast_db_deltree returns the number of row deleted, or a
negative number if it failed. DBdeltree was treating any non-zero return
as an error, causing a spurious verbose error message to be displayed.

This patch handles the return code of ast_db_deltree correctly.

(closes issue ASTERISK-21070)
Reported by: ianc
patches:
  dbdeltree.diff uploaded by ianc (License #5955)


Modified:
    branches/1.8/apps/app_db.c

Modified: branches/1.8/apps/app_db.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/apps/app_db.c?view=diff&rev=381364&r1=381363&r2=381364
==============================================================================
--- branches/1.8/apps/app_db.c (original)
+++ branches/1.8/apps/app_db.c Wed Feb 13 21:42:06 2013
@@ -106,13 +106,15 @@
 		keytree = 0;
 	}
 
-	if (keytree)
+	if (keytree) {
 		ast_verb(3, "DBdeltree: family=%s, keytree=%s\n", family, keytree);
-	else
+	} else {
 		ast_verb(3, "DBdeltree: family=%s\n", family);
+	}
 
-	if (ast_db_deltree(family, keytree))
+	if (ast_db_deltree(family, keytree) < 0) {
 		ast_verb(3, "DBdeltree: Error deleting key from database.\n");
+	}
 
 	return 0;
 }




More information about the asterisk-commits mailing list