From 2830bbef6df5de4d9fd9b2cfa3d468c2aec5e2ce Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 1 Dec 2015 08:31:05 +0100 Subject: [PATCH] package_remove: reset errno when a file does not exist (ENOENT). To not propagate it later on... and also pass rv not errno to the state callback function. --- lib/package_remove.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/package_remove.c b/lib/package_remove.c index 27df6312..1a5ce2e8 100644 --- a/lib/package_remove.c +++ b/lib/package_remove.c @@ -81,10 +81,11 @@ check_remove_pkg_files(struct xbps_handle *xhp, } fail = true; xbps_set_cb_state(xhp, XBPS_STATE_REMOVE_FILE_FAIL, - errno, pkgver, + rv, pkgver, "%s: cannot remove `%s': %s", pkgver, file, strerror(rv)); } + errno = 0; } xbps_object_iterator_release(iter); }