[pacman-dev] [PATCH] Remove a pm_errno = 0 line
In the download code a successful package-download could reset the previously set pm_errno to 0, which is unwanted. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> --- lib/libalpm/dload.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 9b57b97..8e754f1 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -388,7 +388,6 @@ static int curl_download_internal(struct dload_payload *payload, /* shortcut to our handle within the payload */ alpm_handle_t *handle = payload->handle; CURL *curl = get_libcurl_handle(handle); - handle->pm_errno = 0; payload->tempfile_openmode = "wb"; if(!payload->remote_name) { -- 1.7.9
In the download code a successful package-download could reset the previously set pm_errno to 0, which is unwanted.
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
This patch needs testing. Btw, I can see more pm_errno = 0 line in the code, which is not a good practice... NG
On Wed, Feb 8, 2012 at 11:06 PM, Nagy Gabor <ngaba@bibl.u-szeged.hu> wrote:
In the download code a successful package-download could reset the previously set pm_errno to 0, which is unwanted.
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
This patch needs testing. Btw, I can see more pm_errno = 0 line in the code, which is not a good practice... We don't just do this for fun, it is necessary practice in several cases. Please consider the following patch which you are reverting...
commit b008193c1255639f724e3f6c62e50e6f2619e3c2 Author: Dave Reisner <dreisner@archlinux.org> Date: Tue Aug 16 20:10:22 2011 -0400 dload: zero out pm_errno in curl_download_internal This reverts some hacky behavior from 5fc3ec and resets the handle's pm_errno where it should be reset -- prior to each download. This prevents a transaction with a download from being aborted when a package is successfully grabbed from a secondary server.
On Wed, Feb 8, 2012 at 11:06 PM, Nagy Gabor <ngaba@bibl.u-szeged.hu> wrote:
In the download code a successful package-download could reset the previously set pm_errno to 0, which is unwanted.
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
This patch needs testing. Btw, I can see more pm_errno = 0 line in the code, which is not a good practice... We don't just do this for fun, it is necessary practice in several cases. Please consider the following patch which you are reverting...
Yeah, I've just sent an other answer to this thread...
In the download code a successful package-download could reset the previously set pm_errno to 0, which is unwanted.
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
This patch needs testing. Btw, I can see more pm_errno = 0 line in the code, which is not a good practice...
NG
I revoke this patch. That pm_errno = 0 line is there for indicating the successful download of the same file from an other mirror. As a side effect, every successful download clears the "pm_errno history". This is again a design limitation (this should be handled in sync.c). :-(
participants (2)
-
Dan McGee
-
Nagy Gabor