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

Joshua Colp asteriskteam at digium.com
Thu May 24 05:49:22 CDT 2018


Joshua Colp has submitted this change and it was merged. ( 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(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Approved for Submit



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: merged
Gerrit-Change-Id: Ied02b38e8196cb03043e609a0679feebd288d17b
Gerrit-Change-Number: 9032
Gerrit-PatchSet: 1
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180524/c0787274/attachment.html>


More information about the asterisk-code-review mailing list