[asterisk-commits] file: branch file/res_sorcery_astdb r383450 - /team/file/res_sorcery_astdb/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 20 14:29:57 CDT 2013


Author: file
Date: Wed Mar 20 14:29:53 2013
New Revision: 383450

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=383450
Log:
Make the delete function return an error if an object that does not exist is deleted.

Modified:
    team/file/res_sorcery_astdb/res/res_sorcery_astdb.c

Modified: team/file/res_sorcery_astdb/res/res_sorcery_astdb.c
URL: http://svnview.digium.com/svn/asterisk/team/file/res_sorcery_astdb/res/res_sorcery_astdb.c?view=diff&rev=383450&r1=383449&r2=383450
==============================================================================
--- team/file/res_sorcery_astdb/res/res_sorcery_astdb.c (original)
+++ team/file/res_sorcery_astdb/res/res_sorcery_astdb.c Wed Mar 20 14:29:53 2013
@@ -273,8 +273,13 @@
 {
 	const char *prefix = data;
 	char family[strlen(prefix) + strlen(ast_sorcery_object_get_type(object)) + 2];
+	char value[2];
 
 	snprintf(family, sizeof(family), "%s/%s", prefix, ast_sorcery_object_get_type(object));
+
+	if (ast_db_get(family, ast_sorcery_object_get_id(object), value, sizeof(value))) {
+		return -1;
+	}
 
 	return ast_db_del(family, ast_sorcery_object_get_id(object));
 }




More information about the asterisk-commits mailing list