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; } } }