From 12d488ec4705cb26b2f8bfbffc27c3e22acf3d75 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 22 Jun 2011 10:54:06 +0200 Subject: [PATCH] xbps_repository_pool_init: return errno value if a repo sync fails. --- lib/repository_pool.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/repository_pool.c b/lib/repository_pool.c index 59f7a007..64a6ffe4 100644 --- a/lib/repository_pool.c +++ b/lib/repository_pool.c @@ -110,10 +110,15 @@ xbps_repository_pool_init(void) /* file not found, fetch it */ xbps_printf("Synchronizing package index for " "`%s'...\n", repouri); - if (xbps_repository_sync_pkg_index(repouri) == -1) { - xbps_error_printf("failed to fetch " - "pkg-index.plist for `%s': %s\n", - repouri, xbps_fetch_error_string()); + rv = xbps_repository_sync_pkg_index(repouri); + if (rv != 0) { + xbps_error_printf("failed to sync `%s'" + ": %s %s\n", + repouri, strerror(errno), + xbps_fetch_error_string()); + rv = errno; + free(plist); + goto out; } } }