From: Alexei Gradinari Date: Fri, 18 May 2018 21:45:22 +0000 (-0400) Subject: config.c: Fix successful DELETE treated as failure X-Git-Tag: 13.22.0-rc1~52^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6145087cf1a8463d47d5c59728955daa7106700;p=thirdparty%2Fasterisk.git 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 --- diff --git a/main/config.c b/main/config.c index da6d6f108f..12f8739967 100644 --- a/main/config.c +++ b/main/config.c @@ -3577,7 +3577,7 @@ int ast_destroy_realtime_fields(const char *family, const char *keyfield, const 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 {