This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch master in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=81f3c2f460915cfb5f85c4d536b822cf402bb44d commit 81f3c2f460915cfb5f85c4d536b822cf402bb44d Author: Guillem Jover <[email protected]> AuthorDate: Sat Feb 23 04:55:32 2019 +0100 libdpkg: Add new dpkg_error_move() function --- debian/changelog | 1 + lib/dpkg/error.c | 9 +++++++++ lib/dpkg/error.h | 1 + lib/dpkg/libdpkg.map | 1 + 4 files changed, 12 insertions(+) diff --git a/debian/changelog b/debian/changelog index c73e7012f..fc3c98946 100644 --- a/debian/changelog +++ b/debian/changelog @@ -45,6 +45,7 @@ dpkg (1.19.5) UNRELEASED; urgency=medium - dpkg: Switch from a char to an enum to track the force options types. - dpkg: Switch to set the default force option from the forceinfos array. - libdpkg: New benchmark programs and infrastructure. + - libdpkg: Add new dpkg_error_move() function. * Build system: - Check whether this dist is a release, based only on the version format. This will avoid having to do a two staged release to get a proper perl diff --git a/lib/dpkg/error.c b/lib/dpkg/error.c index ecbf35fba..0e88d399a 100644 --- a/lib/dpkg/error.c +++ b/lib/dpkg/error.c @@ -106,6 +106,15 @@ dpkg_error_print(struct dpkg_error *err, const char *fmt, ...) } void +dpkg_error_move(struct dpkg_error *dst, struct dpkg_error *src) +{ + dst->type = src->type; + src->type = DPKG_MSG_NONE; + dst->str = src->str; + src->str = NULL; +} + +void dpkg_error_destroy(struct dpkg_error *err) { err->type = DPKG_MSG_NONE; diff --git a/lib/dpkg/error.h b/lib/dpkg/error.h index 299a6235d..31f8e4e8f 100644 --- a/lib/dpkg/error.h +++ b/lib/dpkg/error.h @@ -58,6 +58,7 @@ int dpkg_put_errno(struct dpkg_error *err, const char *fmt, ...) void dpkg_error_print(struct dpkg_error *err, const char *fmt, ...) DPKG_ATTR_PRINTF(2); +void dpkg_error_move(struct dpkg_error *dst, struct dpkg_error *src); void dpkg_error_destroy(struct dpkg_error *err); /** @} */ diff --git a/lib/dpkg/libdpkg.map b/lib/dpkg/libdpkg.map index 359418992..13728403f 100644 --- a/lib/dpkg/libdpkg.map +++ b/lib/dpkg/libdpkg.map @@ -5,6 +5,7 @@ global: dpkg_put_error; dpkg_put_errno; dpkg_error_print; + dpkg_error_move; dpkg_error_destroy; # Charset and string functions -- Dpkg.Org's dpkg

