From bcaaf60966d71d3e74c94e05a60818cf40196753 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 11 Nov 2011 00:31:09 +0100 Subject: [PATCH] libxbps: xbps_repository_sync_pkg_index: set correct error in err cb. --- lib/repository_sync_index.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/repository_sync_index.c b/lib/repository_sync_index.c index 5458b1ba..cc51c579 100644 --- a/lib/repository_sync_index.c +++ b/lib/repository_sync_index.c @@ -179,7 +179,10 @@ xbps_repository_sync_pkg_index(const char *uri) if (xhp->xbps_transaction_err_cb) { xhp->xtcd->state = XBPS_TRANS_STATE_REPOSYNC; xhp->xtcd->repourl = uri; - xhp->xtcd->err = fetchLastErrCode; + if (fetchLastErrCode != 0) + xhp->xtcd->err = fetchLastErrCode; + else + xhp->xtcd->err = errno; xhp->xbps_transaction_err_cb(xhp->xtcd); } rv = -1;