[Asterisk-code-review] config.c: Fix successful DELETE treated as failure (asterisk[master])

Alexei Gradinari asteriskteam at digium.com
Tue May 22 09:29:30 CDT 2018


Alexei Gradinari has uploaded this change for review. ( https://gerrit.asterisk.org/9032


Change subject: config.c: Fix successful DELETE treated as failure
......................................................................

config.c: Fix successful DELETE treated as failure

The config engine destroy_func callback function returns the number of
rows deleted or -1 on error.  But the function
ast_destroy_realtime_fields treated non-zero return values as error.

ASTERISK-27863

Change-Id: Ied02b38e8196cb03043e609a0679feebd288d17b
---
M main/config.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/32/9032/1

diff --git a/main/config.c b/main/config.c
index 2684fc0..d0447fc 100644
--- a/main/config.c
+++ b/main/config.c
@@ -3568,7 +3568,7 @@
 
 	for (i = 1; ; i++) {
 		if ((eng = find_engine(family, i, db, sizeof(db), table, sizeof(table)))) {
-			if (eng->destroy_func && !(res = eng->destroy_func(db, table, keyfield, lookup, fields))) {
+			if (eng->destroy_func && ((res = eng->destroy_func(db, table, keyfield, lookup, fields)) >= 0)) {
 				break;
 			}
 		} else {

-- 
To view, visit https://gerrit.asterisk.org/9032
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ied02b38e8196cb03043e609a0679feebd288d17b
Gerrit-Change-Number: 9032
Gerrit-PatchSet: 1
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180522/23d7c800/attachment-0001.html>


More information about the asterisk-code-review mailing list