aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2018-11-08 21:27:11 +0200
committerSergey Poznyakoff <gray@gnu.org>2018-11-08 21:32:17 +0200
commit40f3d1c9374c8f2330655acb856b8ecf9bde0767 (patch)
tree9807cc8d2a3bb516f23edab1594c83d5084d04c1
parentaf64e30e538bd8d227432119ab3f54ac8deb03a2 (diff)
downloadmailfromd-40f3d1c9374c8f2330655acb856b8ecf9bde0767.tar.gz
mailfromd-40f3d1c9374c8f2330655acb856b8ecf9bde0767.tar.bz2
Silently ignore non-existing keys in dbdel
* src/builtin/db.bi (dbdel): Treat MU_ERR_NOENT as success.
-rw-r--r--NEWS3
-rw-r--r--src/builtin/db.bi5
2 files changed, 3 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 4c82e291..2d853ac5 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
1Mailfromd NEWS -- history of user-visible changes. 2018-11-05 1Mailfromd NEWS -- history of user-visible changes. 2018-11-08
2See the end of file for copying conditions. 2See the end of file for copying conditions.
3 3
4Please send Mailfromd bug reports to <bug-mailfromd@gnu.org.ua> 4Please send Mailfromd bug reports to <bug-mailfromd@gnu.org.ua>
@@ -10,6 +10,7 @@ Version 8.6.90 (Git)
10** Arguments in transaction between mailfromd and calloutd are quoted 10** Arguments in transaction between mailfromd and calloutd are quoted
11** Avoid false failures in testsuite due to libadns warnings 11** Avoid false failures in testsuite due to libadns warnings
12** configure --with-dbm=T accepts any T supported by mailutils 12** configure --with-dbm=T accepts any T supported by mailutils
13** The 'dbdel' built-in silently ignores non-existing keys
13 14
14Version 8.6, 2018-07-24 15Version 8.6, 2018-07-24
15 16
diff --git a/src/builtin/db.bi b/src/builtin/db.bi
index 8dea160e..4ef11b14 100644
--- a/src/builtin/db.bi
+++ b/src/builtin/db.bi
@@ -404,11 +404,8 @@ MF_DEFUN(dbdel, VOID, STRING dbname, STRING keystr, OPTIONAL, NUMBER null,
404 if (MF_OPTVAL(null, prop && prop->null)) 404 if (MF_OPTVAL(null, prop && prop->null))
405 key.mu_dsize++; 405 key.mu_dsize++;
406 rc = mu_dbm_delete(db, &key); 406 rc = mu_dbm_delete(db, &key);
407 if (rc && rc != MU_ERR_FAILURE)
408 mu_error(_("error deleting %s from %s: %s"),
409 keystr, dbname, mu_dbm_strerror(db));
410 mu_dbm_destroy(&db); 407 mu_dbm_destroy(&db);
411 MF_ASSERT(rc == 0, 408 MF_ASSERT(rc == 0 || rc == MU_ERR_NOENT,
412 mfe_dbfailure, 409 mfe_dbfailure,
413 _("failed to delete data `%s' from `%s': %s"), 410 _("failed to delete data `%s' from `%s': %s"),
414 keystr, 411 keystr,

Return to:

Send suggestions and report system problems to the System administrator.